codemo

Embeds console output to the code

MIT 8 个版本
安装
npm install codemo
yarn add codemo
pnpm add codemo
bun add codemo
README

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

版本列表
1.0.1 2018-04-14
1.0.0 2017-11-09
0.2.2 2017-11-09
0.2.1 2016-06-12
0.2.0 2016-05-22
0.1.1 2016-05-04
0.1.0 2016-04-17
0.0.0 2016-04-17