1.4.0 • Published 2 years ago

@pablo-pg/constant-folding v1.4.0

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

npm version CI for constant-folding

constant-folding

Installation

Write on terminal:

$ npm i @pablo-pg/constant-folding

The output will be similar to this:

Installing

Usage as executable:

After install the package, can be executed with cf:

$ cf input.js

There is an example of using it inside a script in package.json:

Execution npm run

There is also an help message:

Help

Usage from code:

Just write the require and then use the function constantFolding(strCode).

const constantFolding = require('@pablo-pg/constant-folding');
//call the function

The documentation of the function.

Examples

The original code:

let x = 2 + 3 - 5;
let len = [1,2,3].length;
let str = [3,2,1].join('-');

Will produce the next code:

let x = 0;
let len = 3;
let str = '3-2-1';

There is the comprobation:
Test 2

Author

Name: Pablo Pérez González
email: alu0101318318@ull.edu.es

Tests

Test from the production:

Tests

Coverage:

Cov

1.4.0

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago