Skip to content

An object stream that coerces tabular data to numbers

License

Notifications You must be signed in to change notification settings

pluby/coerce-tabular

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coerce-tabular

An object stream that coerces tabular data to numbers. Assumes that all incoming objects have the same set of keys and does not fill in missing values. Supports comma and dot notation (1,23 and 1.23).

npm status Travis build status AppVeyor build status Dependency status

example

npm i detect-tabular coerce-tabular jsonstream

var detect = require('detect-tabular')
  , coerce = require('coerce-tabular')
  , fs     = require('fs')
  , json   = require('jsonstream')

fs.createReadStream('air_pollution_nl.xlsx')
  .pipe( detect() )
  .pipe( coerce() )
  .pipe( json.stringify() )
  .pipe( process.stdout )

api

coerce()

Returns a transform stream. Give it objects in the form of { name: "Alice", nr: "1e-2" } and get back { name: "Alice", nr: 0.01 }.

install

With npm do:

npm install coerce-tabular

license

MIT © Vincent Weevers

About

An object stream that coerces tabular data to numbers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%