
Product
Announcing Bun and vlt Support in Socket
Bringing supply chain security to the next generation of JavaScript package managers
Modular toolkit for parsing, validating, and converting structured datasets (CSV β JSON) with reviewer clarity.
Centralized tooling for parsing, validating, converting, and indexing structured datasets (CSV, JSON, and planned TSV).
Built for modularity, clarity, and service-ready integration.
Most data tools promise seamless automationβbut often operate as opaque black boxes. This obscures subtle quality issues and forces blind trust in processes that should be transparent. When working with critical datasets, that lack of visibility can lead to costly errors or endless manual review.
Nexus DSM takes a different approach:
Your data is yours. You deserve control, clarity, and confidence.
Instead of a βset-it-and-forget-itβ pipeline, Nexus DSM offers a developer-assisted validation engine that flags syntax issues, highlights inconsistencies (like malformed rows or ambiguous headers), and guides you through every step. Whether you're ingesting raw CSVs or preparing JSON for an API, Nexus DSM ensures every byte meets your standardsβwith full visibility and explainable feedback.
This repository contains the core logic for:
β οΈ Note: UI components, drag-and-drop tools, and frontend visualizations are maintained in a separate repository:
nexus-dsm-ui
For more detailed information about the project's direction, contribution guidelines, and version history, please see the following documents:
npm install nexus-dsm # or pnpm add nexus-dsm
The parseCSV function can process a CSV from a file path or a raw string. It returns a detailed response object with the parsed data and rich metadata.
import { parseCSV } from "nexus-dsm";
// From a file path
const response = await parseCSV(undefined, "./data/sample.csv");
if (response.success) {
console.log("Parsed Data:", response.data);
console.log(
"Is eligible for conversion?",
response.meta.eligibleForConversion
);
} else {
console.error("Parsing Failed:", response.message);
console.log("Error Details:", response.meta.diagnostics);
}
The parseJSON function handles JSON files with a root-level array of objects or a single root object.
import { parseJSON } from "nexus-dsm";
const jsonObject = [{ id: 1, name: "Alice" }];
const response = await parseJSON(jsonObject);
if (response.success) {
console.log("Parsed Data:", response.data);
console.log("Structure Type:", response.meta.structureType);
} else {
console.error("Parsing Failed:", response.message);
}
After parsing, you can convert between CSV and JSON formats using the conversion functions. The conversion functions take the entire successful response object from the parser.
The convertToCsv function can perform a "shallow" conversion (default) or a "deep" conversion.
import { parseJSON, convertToCsv } from "nexus-dsm";
const nestedJson = `[{"name":"Alice","profile":{"age":30},"tags":["dev"]}]`;
const jsonResponse = await parseJSON(nestedJson);
// Shallow conversion (default)
const shallow = convertToCsv(jsonResponse);
// shallow.content is: name,profile,tags\r\nAlice,"{""age"":30}","[""dev""]"
// Deep conversion
const deep = convertToCsv(jsonResponse, { flattening: 'deep' });
// deep.content is: name,profile.age,tags[0]\r\nAlice,30,dev
The convertToJson function automatically detects flattened headers (e.g., user.name) and reconstructs the nested JSON structure by default.
import { parseCSV, convertToJson } from "nexus-dsm";
const flatCsv = 'user.name,user.id\nAlice,1';
const csvResponse = await parseCSV(flatCsv);
// The function detects flattened headers and un-flattens by default.
const nestedJson = convertToJson(csvResponse);
// nestedJson.content is: '[{"user":{"name":"Alice","id":1}}]'
// To prevent this and get a flat JSON, pass `unflatten: false`.
const flatJson = convertToJson(csvResponse, { unflatten: false });
// flatJson.content is: '[{"user.name":"Alice","user.id":1}]'
These are the main functions intended for everyday use.
| Function | Description |
|---|---|
parseCSV(data?, filePath?) | Parses a CSV or TSV string/file, validates its structure, and returns a detailed response object. |
parseJSON(data, filePath?) | Parses a JSON string or a pre-parsed object/array, analyzes its structure, and returns a detailed response object. |
convertToCsv(response, options) | Converts a parsed JSON response into a CSV string, with "shallow" (default) or "deep" flattening. |
convertToJson(response, options) | Converts a parsed CSV response into a JSON string, with automatic "un-flattening" of deep CSVs. |
These functions and classes provide lower-level access for custom workflows and analysis.
| Function/Class | Description |
|---|---|
convertCsvStructure(response) | Normalizes a CsvResponse into a standard tabular payload, ready for transformation. |
convertJsonStructure(data, meta) | Normalizes a JsonResponse into a structure-aware payload with detailed metadata. |
ParsedFileMetaBuilder | A fluent builder class to programmatically construct metadata objects for testing or custom parsing. |
calculateNestingDepth(obj) | Computes the maximum nesting depth of a JSON object or array (e.g., a flat object is depth 1). |
checkKeyConsistency(array) | Verifies if all objects in an array share the same keys and returns a list of any inconsistent keys. |
| Library | Best For | DX Simplicity | Streaming | Nested Support | Metadata | Validation | UI Pairing Potential |
|---|---|---|---|---|---|---|---|
| nexus-dsm | DX-first conversion, contributor tooling | βββββ | β (planned) | β Deep + Shallow | β Rich | β Detailed | β High |
| PapaParse | Browser-based parsing, quick CSV import | ββββ | β Step-wise | β (flat only) | β οΈ Minimal | β | β οΈ Limited |
| csvtojson | Quick CLI conversions, Node pipelines | βββ | β Stream | β οΈ Partial flattening | β οΈ Basic | β οΈ Basic | β |
| fast-csv | High-performance streaming in Node | ββ | β Stream | β | β | β | β |
| csv-parse | Configurable parsing, large datasets | βββ | β Stream | β οΈ Manual flattening | β οΈ Basic | β οΈ Manual | β |
π₯ Input file (.csv/.json)
β
π Parsing + Syntax Validation
β
β
Schema Validation
β
π§Ύ Metadata Creation (syntax tree + eligibility flags)
β
π Conversion (CSV β JSON, if eligible)
β
π Optional Indexing & downstream usage
nexus-dsm/
βββ src/
β βββ parsers/ # CSV and JSON parsing logic
β βββ converters/ # Format transformation modules
β βββ validators/ # Syntax, quote balance, header, and schema checks
β βββ schemas/ # Schema definitions
β βββ indexers/ # (Planned) indexing logic
β βββ constants/ # Shared constants
β βββ adapters/ # Environment or format adapters
β βββ utils/ # Shared helpers
β βββ index.ts # Main export file
βββ __tests__/ # Unit and integration tests
βββ lib/ # External libraries (e.g. papaparse.min.js)
βββ api/ # Optional HTTP service layer (Phase 3)
βββ cli/ # Optional CLI wrapper (Phase 4)
βββ docs/ # Specs, architecture diagrams, usage notes
βββ vitest.config.ts # Vitest test runner config
βββ tsconfig.json # TypeScript configuration
βββ CONTRIBUTING.md # Contribution guidelines
βββ LICENSE # Project license
βββ README.md # This file
Use __tests__ with fixtures to simulate:
Built to support mock-driven unit tests and validation suites for CLI, API, or internal tooling.
We welcome PRs, issues, and architectural suggestions. Whether you're extending validation stages, improving conversion logic, or building new adaptersβyour input helps make Nexus DSM more robust and accessible.
This toolkit's powerful and reliable CSV parsing capabilities are made possible by Papa Parse, the fastest in-browser CSV parser for JavaScript.
Modular, testable, and orchestration-ready. Built by Nexicore Digitals to empower developers with clarity and control.
FAQs
Modular toolkit for parsing, validating, and converting structured datasets (CSV β JSON) with reviewer clarity.
We found that nexus-dsm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.