Socket
Socket
Sign inDemoInstall

d3-dsv

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-dsv

A parser and formatter for delimiter-separated values, such as CSV and TSV


Version published
Weekly downloads
3.1M
decreased by-3.94%
Maintainers
1
Weekly downloads
 
Created

What is d3-dsv?

The d3-dsv npm package is designed for parsing and formatting delimiter-separated values, such as CSV and TSV files. It provides a simple and efficient way to work with structured data in text format, making it easier to import, analyze, and export data in web applications.

What are d3-dsv's main functionalities?

Parsing CSV strings

This feature allows you to parse a CSV string into an array of objects, where each object represents a row of the CSV, with properties corresponding to column names.

"var d3 = require('d3-dsv');\nvar csvString = 'name,age\nAlice,30\nBob,42';\nvar data = d3.csvParse(csvString);\nconsole.log(data);"

Formatting objects to CSV

This feature enables you to convert an array of objects into a CSV string, where each object in the array represents a row in the CSV and the object properties represent columns.

"var d3 = require('d3-dsv');\nvar data = [{ name: 'Alice', age: 30 }, { name: 'Bob', age: 42 }];\nvar csvString = d3.csvFormat(data);\nconsole.log(csvString);"

Parsing TSV strings

Similar to parsing CSV strings, this feature allows for parsing TSV (Tab-Separated Values) strings into an array of objects, facilitating the handling of TSV formatted data.

"var d3 = require('d3-dsv');\nvar tsvString = 'name\tage\nAlice\t30\nBob\t42';\nvar data = d3.tsvParse(tsvString);\nconsole.log(data);"

Formatting objects to TSV

This feature allows for converting an array of objects into a TSV string, making it easy to generate TSV formatted data from JavaScript objects.

"var d3 = require('d3-dsv');\nvar data = [{ name: 'Alice', age: 30 }, { name: 'Bob', age: 42 }];\nvar tsvString = d3.tsvFormat(data);\nconsole.log(tsvString);"

Other packages similar to d3-dsv

Keywords

FAQs

Package last updated on 21 Nov 2017

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

  • 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