unfixated

0.0.4 • Public • Published

unfixated

Stream fixed width files into objects

Install

npm install unfixated

How?

var Iconv  = require('iconv').Iconv;
var fs = require('fs');
var UnFixated  = require('unfixated');
 
var stream = fs.createReadStream(path.join(__dirname, 'fixedWidth.txt'));
 
var format = {
  firstName: 30,
  lastName:  30,
  phone:     15,
  address:  100,
};
 
// set conversion function
var iconv = new Iconv('CP1255', 'UTF-8');
var opt = {
  convert: iconv.convert.bind(iconv),
};
 
var unfixated = new UnFixated(format, opt);
 
unfixated.on('data', function(obj) {
  console.log(obj);
});
 
stream.pipe(unfixated);

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    1
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i unfixated

Weekly Downloads

1

Version

0.0.4

License

MIT

Last publish

Collaborators

  • saary