跳到主要内容
CNode

分享一个自己做的 node-repl-tool 包,轻松console调用exports

分享
Aatom2ueki发布于 9 年前
022100
目录 · 4 个章节

node-repl-tool

REPL想必大家并不陌生,但是问题来了,我们要自己去import,然后才能用console测试一下自己写的func,这个包可以轻松地生成一个repl.js,自定义replignore,实现轻松调用js export的object,实现了简单的调试,突发奇想的东西,希望大家能帮忙一同维护进步

A project based auto generated NodeJS REPL tool

Run example

cd example

npm install

npm start

How to use / test

  • Step1: npm install node-repl-tool --save-dev
  • Step2: define your .replignore file, just like .gitignore, so node-repl will ignore those path or files
  • Step3: init node-repl-tool
var repl = require('../src/index');

var project_root_path = __dirname

repl.run(project_root_path)

ctrl+c twice or ctrl+d to exit

Roadmap

  • pack it into npm
  • re-register solution
  • add mocha test cases
  • auto register functions
  • identify ignore file
  • show functions registered
  • watch file changes

Testing

npm test

查看回复

回复 (0)

暂无回复,成为第一个参与讨论的人。

参与回复

登录后即可参与回复。登录