Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/clitetailor/tokenize-monster

Yet another powerful tokenizer in js.
https://github.com/clitetailor/tokenize-monster

functional-programming tokenize tokenizer

Last synced: about 2 months ago
JSON representation

Yet another powerful tokenizer in js.

Awesome Lists containing this project

README

        

Tokenize Monster
================

> Yet another powerful tokenizer in **JS**.

Installation
------------

```bash
npm install --save tokenize-monster
```

Getting Started
---------------

```javascript
const tokenizer = require('tokenize-monster');

const tokens = tokenizer.matchAndMap(
'i\'d like to some ',
/<[^><]+>/,
text => [[text]],
text => [text]
);

console.log(tokens);
// => [ 'i\'d like to ', [ '' ], ' some ', [ '' ], '' ]

const nTokens = tokenizer.matchAndMap(
'i\'d like to some ',
/<[^><]+>/,
text => [text],
text => []
);

console.log(nTokens);
// => [ '', '' ]
```

Example
-------

- [Simple XML Parser](https://github.com/clitetailor/simple-xml-parser)

Documentation
-------------

Our docs are available at [Tokenize Monster Wiki](https://github.com/clitetailor/tokenize-monster/wiki).

Changelog
---------

Visit [Github Releases](https://github.com/clitetailor/tokenize-monster/releases) page for more information.