@mawngo/pipe-parser
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

Pipe Parser

Declarative format parser for declarative template engines (like angular pipe)

Installation

# Using npm
npm install --save @mawngo/html-parser

Usage

const {parse, parseRaw} = require('@mawngo/pipe-parser');

parse('date:"2022-01-18"'); //=> [{name: 'date', args: ['2022-01-18']}]
parse('myfunc:1,"foo",true'); //=> [{name: 'myfunc', args:[1, 'foo', true]}]
parse('myfunc:"foo","true"'); //=> [{name: 'myfunc', args:['foo', 'true']}]
parse('trim | date:"2022-01-18"'); //=> [{name: 'trim', args:[]}, {name: 'date', args: ['2022-01-18']}]

parseRaw('myfunc:1,"foo",true') //=> [{name: 'myfunc', args:['1', 'foo', 'true']}]

// Only support simple type
parse('myfunc:{foo:"bar"}'); //=> [{name: 'myfunc', args:['{foo:"bar"}']}]

Readme

Keywords

Package Sidebar

Install

npm i @mawngo/pipe-parser

Weekly Downloads

5

Version

1.5.1

License

MIT

Unpacked Size

7.92 kB

Total Files

8

Last publish

Collaborators

  • sitdownrightnow.dev