New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

parseur

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parseur

A tiny parsing library

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
2
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

Parseur, easy, fast and small typescript parsing

Parseur is a tiny (1.7k uglified + gziped) parsing library meant to be used with Typescript.

It is fairly fast, and was designed so that writing grammars would be concise and neatly typed.

It functions by combining parsers and executing them on an array of tokens.

Basic parsers

Seq(silent_rule1, { named: rule2, other: rule3 }, ...)
  // A sequence of rules.
  // Unless put in objects, rules matched are not part of the result, which
  // is an object.

Either(rule1, rule2, ...)
  // Returns the first match

Repeat(rule) /* or */ rule.Repeat
  // Repeat a rule zero or more times, like *

OneOrMore(rule) /* or */ rule.OneOrMore
  // Repeat a rule one or more times, like +

SeparatedBy(rule, sep) /* or */ rule.SeparatedBy(sep)
  // A Helper to repeat a rule one or more times with each match separated
  // by a separator.

Opt(rule)
  // Match a rule and return its result if found or return `null` if not.

Not(rule)
  // Negative look-ahead

Keywords

parsing

FAQs

Package last updated on 24 Apr 2020

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