0.0.4 • Published 2 years ago

compile-expression v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

compile-expression

Compile javascript expressions (including jsx), producing javascript values

Environment

  • Node: >= 10.8.0
  • Browser: Not support

Install

npm i -S compile-expression

Usage

const {compileExpression} = require('compile-expression');

compileExpression('1 + 2');
// 3

compileExpression('foo.toFixed(2)', { foo: 5 });
// "5.00"

compileExpression('<div>foo</div>', { React: require('react') });
// {
//   '$$typeof': Symbol(react.element),
//   type: 'div',
//   key: null,
//   ref: null,
//   props: { children: 'foo' },
//   _owner: null,
//   _store: {}
// }
0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.1-beta.0

2 years ago