0.1.1 • Published 9 years ago

varstr v0.1.1

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

varstr

Variable width parser.

##To use:

  • Define a transformer with a variable delimiter (in this case, '~')
var vs = require('varstr');
var transformer = vs('~', [
  vs.str('foo'),
  vs.str('bar'),
  vs.number('baz')
]);
  • Objectifiy or Stringify as needed
transformer.objectify('F~Bar~3');
// => { foo: 'F', bar: 'Bar', baz: 3}

transformer.stringify({ foo: 'F', bar: 'Bar', baz: 3});
// => 'F~Bar~3'