import { parseJson, parseJsonFile } from '@discord/intl-flat-json-parser';
// Parse a string as flat JSON
const jsonContent = `{
"MESSAGE_ONE": "Hello, this is the first message",
"MESSAGE_TWO": "Another message!"
}`;
const messages = parseJson(jsonContent);
console.log(messages[0]);
//=> {
// key: "MESSAGE_ONE",
// value: "Hello, this is the first message",
// position: {
// line: 2,
// col: 19
// }
// }
// Or pass a file path to get parsed directly from the file system
const directMessages = parseJsonFile('some/file/path.json');