rewardio-csv-normaliser
v1.0.0
Published
A small browser and CLI utility for normalising messy CSV headers and rows.
Maintainers
Readme
Rewardio CSV Normaliser
A small, dependency-free CSV utility for cleaning messy CSV files before they enter a spreadsheet, import workflow, or reporting pipeline.
It can:
- normalise messy headers into
snake_case,kebab-case,camelCase, lowercase words, title words, or original headers - trim whitespace from cells
- remove empty rows
- deduplicate repeated column names
- parse quoted commas and escaped quotes
- run in the browser, as a Node library, or from the command line
Browser Tool
Open the GitHub Pages site for this repository, paste or upload a CSV, preview the cleaned output, and download the normalised file:
https://rewardio-com.github.io/rewardio-csv-normaliser/CLI Usage
npx rewardio-csv-normaliser input.csv --output cleaned.csvOr pipe data through stdin:
cat input.csv | npx rewardio-csv-normaliser > cleaned.csvOptions:
--output, -o <file> Write output to a file
--case <style> snake, kebab, camel, lower, title, original
--delimiter <value> Override delimiter. Use "tab" for tab-separated files
--keep-empty Keep empty data rows
--no-trim Do not trim cell whitespaceNode Usage
import { normaliseCsv } from "rewardio-csv-normaliser";
const result = normaliseCsv(csvText, {
headerCase: "snake",
trimCells: true,
removeEmptyRows: true,
});
console.log(result.output);
console.log(result.stats);Local Development
npm install
npm test
npm startThen open http://127.0.0.1:5173.
Publishing
npm publish --access publicBuilt by Rewardio.
