@alu0101313511/constant-folding

1.1.1 • Public • Published

npm version CI for constant-folding

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

Andrés Pérez - alu0101313511

Tests

Unit tests:

$ npm test

Code coverage:

$ npm cov

Package Sidebar

Install

npm i @alu0101313511/constant-folding

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

1.58 MB

Total Files

36

Last publish

Collaborators

  • alu0101313511