New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

csv-utilities

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-utilities

A simple utility to manipulate and transform csv strings of data.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

CSV Utilities

A simple utility to manipulate and transform csv strings of data.

Install

npm i csv-utilities

Usage

csv2array

const csv = require('csv-util')

csv.csv2array(csv)

// returns a mutlidimensional array

array2CSV

const csv = require('csv-util')

csv.array2csv(array)

// returns a csv string

switchColumnsOrder

Switches the order of two columns in the csv string

switchColumnsOrder(csvString, column1, column2)

csv.switchColumnsOrder(csv, 1, 4)

// outputs a csv string with the columns 1 and 4 switched

sortColumns

Sorts each column in a row lowest to highest or alphabetically

csv.sortColumns(csv)

reverseRows (Top to bottom)

Reverses the order of all the rows

csv.reverseRows(csv)

avgColumns

Averages the numbers in each column in a row and creates an array

1, 2, 3
2, 1, 3

outputs:

[2 , 2]

appendColumns

Appends an array of columns into the csv

appending this:

[5, 6]

to this:

1, 2, 4
2, 1, 3

outputs:

1, 2, 3, 5
2, 1, 3, 6

appendRows

Keywords

csv

FAQs

Package last updated on 29 May 2018

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