@lanthanion/json2csv
v1.0.4
Published
Convert JSON to csv
Downloads
1
Readme
How to Install
You can install json2csv as a dependency using NPM. Requires Node v12 or higher.
# Global so it can be called from anywhere
$ npm install -g @lanthanion/json2csv
# or as a dependency of a project
$ npm install @lanthanion/json2csv --save
Usage
import { convert } from '@lanthanion/json2csv';
import * as fs from 'fs';
fs.readFileSync('foo.txt', 'utf8');
const data = [
{
name: 'Persius',
email: '[email protected]',
},
];
console.log(convert(data));
fs.writeFileSync(new URL(fileURL), data, { encoding: encoding });