How to use the coffeescript/lib/coffeescript/coffeescript.eval function in coffeescript

To help you get started, we’ve selected a few coffeescript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BoostIO / boostnote-mobile / app / lib / CofeeScriptEval.js View on Github external
const CoffeeScript = require('coffeescript/lib/coffeescript/coffeescript')
const compile = CoffeeScript.compile

CoffeeScript.eval = function(code, options = {}) {
    if (options.bare == null) {
        options.bare = true
    }
    return eval(compile(code, options))
}

module.exports = CoffeeScript