Registry / data / esbuild-plugin-dsv

esbuild-plugin-dsv

JSON →
library0.0.4jsnpmunverified

An esbuild plugin that enables importing .tsv and .csv files as ES6 modules. Current stable version is 0.0.4. It uses d3-dsv under the hood to parse tabular data and returns a DSVRowArray (array of objects). The plugin supports a transform option to mutate parsed data before bundling. Compared to other CSV loaders for esbuild, this plugin is minimal and focused, but it has very low maintenance activity and may not be suitable for production use due to its early stage.

npm install esbuild-plugin-dsv
INSTALL
IMPORT
SIG · ESBUILD-PLUGIN-DSV
E
esbuild-plugin-dsv
datajavascriptv0.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dsvPlugin
✓ import { dsvPlugin } from 'esbuild-plugin-dsv'
✗ import dsvPlugin from 'esbuild-plugin-dsv'
The plugin is exported as a named export, not default. CommonJS users should use const { dsvPlugin } = require('esbuild-plugin-dsv').
DSVPluginOptions
✓ import type { DSVPluginOptions } from 'esbuild-plugin-dsv'
Type import for TypeScript users; not available in JavaScript.
DSVRowArray
✓ import type { DSVRowArray } from 'esbuild-plugin-dsv'
✗ import { DSVRowArray } from 'esbuild-plugin-dsv'
DSVRowArray is a type re-exported from d3-dsv; use type import only.

Registers the DSV plugin with esbuild, allowing import of .csv and .tsv files in bundled code.

const esbuild = require('esbuild'); const { dsvPlugin } = require('esbuild-plugin-dsv'); async function build() { await esbuild.build({ entryPoints: ['src/index.js'], bundle: true, outfile: 'dist/bundle.js', plugins: [dsvPlugin()], }); } build();
Debug
Known issues
gotchaPlugin does not validate CSV/TSV file extensions; any file imported with .csv or .tsv extension will be parsed, potentially causing errors on malformed data.
fix
Ensure imported CSV/TSV files are valid tabular data with headers.
affects: >=0.0.0
gotchaThe plugin does not support custom delimiter or quoting; it uses d3-dsv defaults which assume comma separated values and double quotes.
fix
Transform the data manually using d3-dsv's csvParse with custom options.
affects: >=0.0.0
gotchaVersion 0.0.4 is very early; breaking changes may occur without major version bump.
fix
Pin exact version in package.json and test upgrades thoroughly.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'esbuild-plugin-dsv'
Package is not installed.
fix
Run npm install --save-dev esbuild-plugin-dsv
TypeError: dsvPlugin is not a function
Importing default instead of named export.
fix
Use import { dsvPlugin } from 'esbuild-plugin-dsv' instead of import dsvPlugin from ...
Upgrade
Version history
0.0.4latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency for plugin integration
d3-dsvrequiredUsed internally for CSV/TSV parsing
Agent activity
4 hits · last 30 days
node
4
Resources
esbuild-plugin-dsv — npm install esbuild-plugin-dsv · libregistry