0.0.1 • Published 5 years ago

flextag v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

flextag

NPM version

This is a collection of tools for working with flextags in JavaScript. The tools themselves each live in other modules, and you might prefer to use them directly. They are gathered here for convenience, as a form of endorsement, and for integration testing.

Command Line

(sketch - not yet implemented)

$ cat data.txt
La la la Hello, World! la la la
$ cat greetings.tagmap
?type=1 Hello ?zone!
$ flextag parse --template greetings.tagmap data.txt
{"type":1, "zone":"World"}
$

This just falls through to flextag-parse from the flextag-mapper-cli module.

API

(sketch - not yet implemented)

const flextag = require('flextag')

const mapper = flextag.mapper()
mapper.on('Hello, World!', () => {
  console.log('They said Hi!')
})

mapper.parse('La la la Hello, World! la la la')
// => They said Hi!