Socket
Socket
Sign inDemoInstall

@types/d3-dsv

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/d3-dsv

TypeScript definitions for d3-dsv


Version published
Weekly downloads
2.1M
increased by9.71%
Maintainers
1
Weekly downloads
 
Created

What is @types/d3-dsv?

@types/d3-dsv provides TypeScript type definitions for the d3-dsv library, which is part of the D3.js suite. The d3-dsv library is used for parsing and formatting delimiter-separated values (DSV) such as CSV (comma-separated values) and TSV (tab-separated values).

What are @types/d3-dsv's main functionalities?

Parsing CSV

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

const d3 = require('d3-dsv');
const csvData = 'name,age\nAlice,30\nBob,25';
const parsedData = d3.csvParse(csvData);
console.log(parsedData);

Formatting CSV

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

const d3 = require('d3-dsv');
const data = [
  { name: 'Alice', age: 30 },
  { name: 'Bob', age: 25 }
];
const csvString = d3.csvFormat(data);
console.log(csvString);

Parsing TSV

This feature allows you to parse TSV data into an array of objects. Each object represents a row, with properties corresponding to the column names.

const d3 = require('d3-dsv');
const tsvData = 'name\tage\nAlice\t30\nBob\t25';
const parsedData = d3.tsvParse(tsvData);
console.log(parsedData);

Formatting TSV

This feature allows you to format an array of objects into a TSV string. Each object represents a row, with properties corresponding to the column names.

const d3 = require('d3-dsv');
const data = [
  { name: 'Alice', age: 30 },
  { name: 'Bob', age: 25 }
];
const tsvString = d3.tsvFormat(data);
console.log(tsvString);

Other packages similar to @types/d3-dsv

FAQs

Package last updated on 07 Nov 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

  • 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