Socket
Book a DemoInstallSign in
Socket

et-parser

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

et-parser

A library to parse string.

0.1.8
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

et-parser NPM version

Installation

npm install et-parser --save-dev

Useage


var Parser = require('et-parser').Parser

var table = `
          | text       | emojiStart | emojiKey   | emojiEnd
--------  | ----       | ---------- | --------   | --------
[         | emojiStart | emojiStart | emojiStart | emojiStart
]         | text       | text       | emojiEnd   | text
:[\\w\\.] | text       | emojiKey   | emojiKey   | text
          | text       | text       | text       | text
`

var parser = new Parser(table)
parser.parse('header[emoji.smile]tail', function (state, token, index) {
  console.log(state, token, index)
})

The result will be:

text h 0
text e 1
text a 2
text d 3
text e 4
text r 5
emojiStart [ 6
emojiKey e 7
emojiKey m 8
emojiKey o 9
emojiKey j 10
emojiKey i 11
emojiKey . 12
emojiKey s 13
emojiKey m 14
emojiKey i 15
emojiKey l 16
emojiKey e 17
emojiEnd ] 18
text t 19
text a 20
text i 21
text l 22

License

MIT

Keywords

parser

FAQs

Package last updated on 29 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.