Socket
Book a DemoInstallSign in
Socket

csv-homie

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-homie

CSV manager

0.6.4
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

CSV manager

Maintainability Test Coverage

Friendly manager for CSV.

Example

import { stringify } from 'csv-homie';

const dataArray = [
  ['a', 'b', 'c', 'd'],
  [1, 2, null, 4],
  [5, 6, 7, 8],
];
// with default options - 2th parameter
stringify(dataArray);
// 'a,b,c,d\n1,2,,4\n5,6,7,8'

const dataCollection = [
  { a: 'b', c: 'd', x: undefined, y: '' },
  { a: 'f', c: 0, x: null, y: NaN },
];
// custom options - 2th parameter
stringify(dataCollection, {
  headers: false,
  delimiter: '|',
  isEmptyIfNullable: false,
});
// 'b|d||\nf|0|null|null'

API

2th parameter, default values commented.

interface IOptions {
  headers: boolean; // true
  isEmptyIfNullable: boolean; // true
  delimiter: string; // ','
}

Dev

npm ci
npm test

Keywords

csv

FAQs

Package last updated on 12 Dec 2023

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.