Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 8, 2024 via pnpm

csvtojson 2.0.10

A tool concentrating on converting csv data to JSON with customised parser supporting
Package summary
Share
0
issues
1
license
5
MIT
Package created
17 Jun 2013
Version published
26 Jun 2019
Maintainers
1
Total deps
5
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
5 Packages, Including:
bluebird@3.7.2
csvtojson@2.0.10
is-utf8@0.2.1
lodash@4.17.21
strip-bom@2.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of csvtojson 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
bluebird3.7.2136.03 kBMIT
prod
lodash4.17.21311.49 kBMIT
prod
strip-bom2.0.01.75 kBMIT
prod

Visualizations

Frequently Asked Questions

What does csvtojson do?

csvtojson is a comprehensive Node.js module primarily used for converting CSV data to JSON or column arrays. It follows the strict CSV definition RF4180 and is built to work with substantial lines of CSV data. The module provides a plethora of parsing parameters as well as support for async and streaming parsing. Additionally, it encompasses a built-in CSV parsing tool for command-line usage and provides a CSV parser for both Node.js and web browsers. It presents options for developers such as 'pre-defined' helpers and flexibility in usage. Furthermore, it emphasizes high-speed performance, making it an optimal choice for large datasets.

How do you use csvtojson?

The usage of the csvtojson module is quite straightforward. After installing the module using npm (npm i --save csvtojson), it can be imported for use within your JavaScript code. The basic usage involves calling a function provided from the csvtojson package and invoking fromFile() or fromStream() to read from a CSV file or a stream, and then() to handle the parsed JSON objects.

Here's an example of reading from a CSV file:

const csv=require('csvtojson')
const csvFilePath='<path to csv file>'

csv()
.fromFile(csvFilePath)
.then((jsonObj) => {
	console.log(jsonObj);
})

You can also read from a CSV string or a stream, or process each line from a CSV URL asynchronously:

const request=require('request')
const csv=require('csvtojson')

csv()
.fromStream(request.get('http://mywebsite.com/mycsvfile.csv'))
.subscribe((json)=>{
	return new Promise((resolve,reject)=>{
		// long operation for each json e.g. transform / write into database.
	})
},onError,onComplete);

For more detailed usage, please refer to the package's API documentation.

Where are the csvtojson docs?

The csvtojson module's documentation can be found on the GitHub page of the project, under the URL: https://github.com/Keyang/node-csvtojson. The documentation is very detailed and covers a wide variety of usage examples, including installation, quick start, API, browser usage, and other parameters. There are also guides for upgrading to version 2 as well as specific documentation for version 1, should developers be using that version.