0.4.0 • Published 5 years ago

acorn-sontag v0.4.0

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years 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.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.33

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago