1.3.4 • Published 3 years ago

@alu0101207957/constant-folding v1.3.4

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

npm version Node.js CI

Constant-Folding

Installation

Using npm

npm install @alu0101207957/constant-folding

Put it in the package.json

"dependencies": {
    "@alu0101207957/constant-folding": "^1.3.3",
    ...
    }

Usage as executable:

node bin/constant-folding-cli.js <input> -o <output>

It does constant folding to the code and return it in other file

Usage from code:

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

The documentation of the function.

Examples

console.log(constantFolding(`12+7`));
//19

Author

alu0101207957 Andrés Zeus Hernández Impini

Tests

    ✔ Test 12+7 = 19;
    ✔ Test 12-7 = 5;
    ✔ Test 12+7-3-4; = 12;
    ✔ Test 12+7+a; = 19 + a;
    ✔ Test 12+7+"a"; = '19a';
    ✔ Test [1,2,3].length = 3;
    ✔ Test [1,2,3][2-1] = 2;
    ✔ Test [1,2,3].pop() = 3;
    ✔ Test [1,2,3].slice(0,1+1) = [
    1,
    2
];```
1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago