@alu0101313511/constant-folding
v1.1.1
Published
Constant Folding javascript code
Downloads
13
Maintainers
Readme
constant-folding
This package allows you to apply Constant Folding to your Javascript code.
Constant folding is the process of recognizing and evaluating constant expressions at compile time rather than computing them at runtime.
Installation
$ npm install @alu0101313511/constant-folding
Usage as executable:
$ npx cf
More information about the executable:
$ npx cf --help
Usage from code:
const constantFolding = require('constant-folding');
//call the function
The documentation of the function
Examples
$ cat input.js
let v = 3 + 4 + 2;
$ npx cf input.js output.js
$ cat output.js
let v = 9;
Author
Tests
Unit tests:
$ npm test
Code coverage:
$ npm cov