pkgeval

Evaluates the given expression and returns the result.

1
0
1
1
JavaScript
public

pkgeval 0.9.0

One configuration to rule them all

npm
license
travis
greenkeeper
mind BLOWN

.

pkgcfg tag to evaluate Javascript expressions.

.

Installation

npm install --save pkgeval

Registration

The eval{} tag from pkgeval will be auto-discovered by pkgcfg because it follows
the package naming convention. You can also register it explicitly by adding 'eval'
to the array of pkgcfg tags in package.json. See the pkgcfg docs on
using external tags
for more information.

Usage

package.json:

{
  "eval": "eval{3 > 5}",
  "evalIndirect": "eval{${data} > 5}",
  "data": "8",
}

Then, read your package.json with pkgcfg:

var cfg = require('pkgcfg')();
console.info(cfg.test.eval) // false
console.info(cfg.test.evalIndirect); // true

eval{expr}

Evaluate Javascript expressions.

expr

Required String. The expression to evaluate.

Issues

Add an issue in this project’s issue tracker
to let me know of any problems you find, or questions you may have.

Copyright 2016 by Stijn de Witt. Some rights reserved.

License

Creative Commons Attribution 4.0 (CC-BY-4.0)

v0.3.3[beta]