Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-generate-csv

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-generate-csv - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

package.json
{
"name": "node-generate-csv",
"version": "1.0.6",
"version": "1.0.7",
"description": "Create CSV by codrrdev",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -1,3 +0,81 @@

# Create CSV by JSON
# node-generate-csv
Install: `npm install node-generate-csv`
[![npm version](https://img.shields.io/npm/v/node-generate-csv)](https://www.npmjs.com/package/node-generate-csv)
This package intelligently orders the export to CSV
## Install as an NPM module
```bash
$ npm install node-generate-csv
```
### Usage
```TypeScript
import { CreateExportCSV } from 'node-generate-csv'
```
or
```JavaScript
const { CreateExportCSV } = require('node-generate-csv');
```
## How to use
### Basic
```TypeScript
interface DataType {
year: number;
name: string;
hasADog?: boolean;
hasACat?:boolean
}
const data: DataType[] = [
{
year: 25,
name: "Ana"
},
{
year: 50,
name: "Thomas"
},
{
year: 18,
name: "Louise"
},
{
year: 20,
name: "Alex"
},
{
year: 46,
name: "Mark",
hasADog: true, //Optional parameter
},
{
year: 38,
name: "Mariia",
hasACat: false, //Optional parameter
}
]
new CreateExportCSV<DataType>(data, 'tmp/testfile') //If you add a folder, you must separate it with "/" and you will find it
```
### Output
```Text
year,name,hasADog,hasACat
25,Ana,,,
50,Thomas,,,
18,Louise,,,
20,Alex,,,
46,Mark,true,,
38,Maria,,false
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc