0.0.1 • Published 5 years ago

promise-eval v0.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Promise eval

Usage

    const evil = require('promise-eval');
    evil('2 + 2').then(r => {
        console.log(r);
    }).catch(e => e);
    /* output: 4 */

Safe eval

    const { safe } = require('promise-eval');
    safe('process').then(r => {
        console.log(r);      
    }).catch(e => e);
    /* 
    Error! process is not defined
    */
0.0.1

5 years ago