@plurnk/plurnk-mimetypes-text-csv
v1.0.5
Published
text/csv mimetype handler for plurnk-service. Homebrew RFC 4180 tokenizer; no parser dependency.
Readme
@plurnk/plurnk-mimetypes-text-csv
text/csv mimetype handler for the plurnk ecosystem.
install
npm i @plurnk/plurnk-mimetypes-text-csvwhat it does
validate(content)walks all records with the bundled RFC 4180 tokenizer; throws on unbalanced quotes or non-uniform column count.extractRaw(content)emits onefieldsymbol per header column (the first record), at line 1.
CSV's structural signal is the header row's column names — that's what surfaces in symbols. The actual data body is best previewed via the framework's raw-content fallback.
why no parser dependency
CSV is the textbook case where RFC 4180 fits in <100 LOC of careful hand-rolled tokenizer and the available libraries all carry transitive dependencies that don't earn their keep for header extraction. The tokenizer (parseAll) is exported for re-use.
license
MIT.
