🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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

Create CSV by codrrdev

1.0.7
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

node-generate-csv

npm version

This package intelligently orders the export to CSV

Install as an NPM module

$ npm install node-generate-csv

Usage

import { CreateExportCSV } from 'node-generate-csv'

or

const { CreateExportCSV } = require('node-generate-csv');

How to use

Basic


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

year,name,hasADog,hasACat
25,Ana,,,
50,Thomas,,,
18,Louise,,,
20,Alex,,,
46,Mark,true,,
38,Maria,,false

Keywords

csv

FAQs

Package last updated on 24 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts