TokenParser
TokenParser is a library to replace tokenized string. It has a build in extensible lexer to parse text and find expressions. By default, it will expect expressions encapsulated with [
and ]
, and will use angular-expression to parse the expressions.
Install
TokenParser is available for both node.js and browser environments, throught a browserified bundle available at dist/token-parser.js
(and it's minified version).
NPM
Simply install it via npm install token-parser
and use it with require('token-parser')
.
Bower
Install it with bower install token-parser
and add it to your project with a common script tag. The TokenParser
will be made available globally.
Usage
var TokenParser = ;var parser = ; // Do not forget to initialize it. This step is necessary so that extending// lexer could be possible.parser; // "Text"parser; // "undefined" parser; // "Text"parser; // "Text"parser; // "Text foo!"parser; // "Text"parser; // FILTERS//-------- parser; // "Text FOO!"parser;