WhatsApp chat export to JSON converter using Node.js
npm install whatsapp-to-json.txt file exported by WhatsApp and outputs a .json file with an array of messages as objects.
output.json file is an array of the interface:
typescript
interface messageObj {
id: number;
message: {
date: string;
time: string;
sender: string;
content: string;
};
}
`
Using as an npm package
To use this package in a Node.js project, first install it using
`bash
npm install whatsapp-to-json
`
or
`bash
yarn add whatsapp-to-json
`
Then import it using
`javascript
import { converter } from "whatsapp-to-json";
`
Then you can use it like
`javascript
const convertedArray = converter(PATH_TO_FILE);
``