1.0.1 • Published 6 years ago

codemo v1.0.1

Weekly downloads
142
License
MIT
Repository
github
Last release
6 years ago

codemo

Embeds console output to the code

npm version Build Status Coverage Status

Installation

npm i -S codemo

Usage

const codemo = require('codemo')

codemo
  .process("console.log('Hello world!')")
  .then(result => consle.log(result))

The result will be

console.log('Hello world!')
//> Hello world!

API

codemo.process(code, [opts])

Return a promise with the resulting file combined with output.

  • opts.cwd - the directory in which the code should be executed
  • opts.es6 - whether the code is written using ES6

codemo.processFile(filePath, [opts])

Return a promise with the resulting file combined with output.

  • opts.es6 - whether the code is written using ES6

License

MIT © Zoltan Kochan