@lanthanion/json2csv
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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: 'persius@poseidon.com',
  },
];
console.log(convert(data));
fs.writeFileSync(new URL(fileURL), data, { encoding: encoding });

Package Sidebar

Install

npm i @lanthanion/json2csv

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

6.47 kB

Total Files

10

Last publish

Collaborators

  • aokode