The `tsv` package provides a lightweight, dependency-free solution for converting between JSON and Tab-Separated Values (TSV) or Comma-Separated Values (CSV) formats. Currently at version 0.2.0 (published 13 years ago), this library is explicitly marked by its author as unmaintained and unsuitable for production environments due to its synchronous parsing, inefficiency with large datasets, and vulnerability to non-sanitized input data. It was originally designed for efficiently serving small datasets to client-side visualization libraries like D3.js. Given its age and the author's deprecation notice, it lacks modern features like asynchronous processing, robust error handling for malformed data, and native ESM support, common in contemporary data parsing libraries.
npm install tsvVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic TSV and CSV stringification and parsing, including creating a custom parser for other delimiters. Shows synchronous API usage.
Migrate to a actively maintained and robust parsing library such as `papaparse` or `csv-parse` which support modern JavaScript features, asynchronous processing, and handle complex data scenarios reliably.
For large files or server-side applications, use a streaming parser that handles data asynchronously to prevent blocking the main thread, such as `node-csv-parser`.
Ensure all input data is strictly formatted according to TSV/CSV standards or utilize a more resilient parsing library that offers robust error handling and configuration for various data anomalies.
For ESM projects, consider using dynamic `await import()` if absolutely necessary, but preferably switch to a modern library with native ESM support. Otherwise, ensure your project is configured for CommonJS compatibility.
Ensure you are accessing `TSV` or `CSV` as properties of the object returned by `require('tsv')`, e.g., `const { TSV, CSV } = require('tsv');` or `const tsvModule = require('tsv'); tsvModule.TSV.stringify(...)`.Transform your data into a `[{ key1: val1, key2: val2 }, { key1: val3, key2: val4 }]` structure before calling `stringify`. Ensure the array is not empty and contains valid objects.No dependency data recorded yet.