Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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.0.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

et-parser NPM version

Installation

npm install et-parser --save-dev

Useage


var Parser = require('et-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

FAQs

Package last updated on 19 Jan 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc