0.5.0 • Published 1 year ago

acorn-sontag v0.5.0

Weekly downloads
6
License
MIT
Repository
github
Last release
1 year ago

acorn-sontag

An Acorn-based parser for Sontag expressions.

Installation

# using npm
npm install acorn-sontag

# using yarn
yarn add acorn-sontag

Usage

let { expression } = require('acorn-sontag');

let result = expression('posts[posts.length - 1] | escape', {
	// The scope to add to filters
	filterScope: 'this.__filters__',

	// The scope to add to other identifiers
	identifierScope: 'this',

	// The name of the range function to call 
	// for the `..` range operator
	rangeFunction: 'this.__filters__.range',
});

console.log(result);
// => this.__filters__.escape(this.posts[this.posts.length - 1])
0.5.0

1 year ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.4

6 years ago

0.0.33

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago