Fixed width text stream for node.js
Easily create fixed width text stream/files with node.js
npm install --save fixated
var Fixated = require('Fixated');
var format = {
firstName: 15,
lastName: 15,
address: 200,
};
var fixated = new Fixated(format);
fixated.pipe(require('fs').createWriteStream('./out.txt');
fixated.write({firstName: 'charlie', lastName: 'doe', address: '1st some road, some where'});
fixated.end();
// out.txt should contain one line:
// charlie doe 1st some road, some where
MIT