Just safe(?) eval function
npm install seval
or yarn add seval
const seval = require('seval')
const { basic: dangerlist } = require('seval/presets')
// preset list: basic, infLoop, this, blockAll
seval('console.log("Hello, world!")', { dangerlist })
- Make a separated box
- Insert some codes
- Remove some danger things
- Run the codes in the box
- Wow, super safe