The `csv-spectrum` package offers a comprehensive, standardized collection of diverse CSV files specifically designed for rigorously testing and validating CSV parsing libraries. Its primary goal is to provide an 'acid test' for parsers, capturing a wide array of CSV formatting edge cases, common variations, and even malformed inputs to ensure robust implementation. Each CSV test case is conveniently paired with a corresponding JSON file, enabling straightforward verification of parsing results. Currently stable at version 2.0.0 (last updated approximately 8 years ago), this library is primarily used as a development dependency within the test suites of CSV processing tools. Its core value lies in offering programmatic access to a 'spectrum' of challenging CSV data, aiding developers in building highly resilient parsers. Due to its nature as a static dataset, it is in a maintenance status and does not see frequent updates or new features, focusing instead on stability and its intended purpose.
npm install csv-spectrumVerified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic loading and initial inspection of all CSV and corresponding JSON test cases.
For ESM projects, use `const spectrum = require('csv-spectrum')` within a CJS wrapper or leverage Node.js's `createRequire` utility: `import { createRequire } from 'module'; const require = createRequire(import.meta.url); const spectrum = require('csv-spectrum');`.Be aware of its unmaintained status. For critical applications, consider auditing the test data yourself. For static test data, this is often acceptable, but it means no future adaptations to new JavaScript features or environments.
In an ESM file, if you must use `require()`, utilize `import { createRequire } from 'module'; const require = createRequire(import.meta.url); const spectrum = require('csv-spectrum');`. Alternatively, use a build tool like Webpack or Rollup configured to handle CJS modules.Ensure you are using `const spectrum = require('csv-spectrum')` for CJS, as the package exports a single function directly as `module.exports`, not an object with a 'spectrum' property.No dependency data recorded yet.