bodule
v0.1.0
Published
a tool for wrapping commonjs to browser !
Downloads
5
Readme
Bodule ['bɑdʒul]
Bodule是一个将Node包导入给浏览器端的解决方案,本repo是该方案的核心——将一个node模块cmd化。
API
bodule(path, code, pkg)
var bodule = require('bodule')
var code = "var _ = require('underscore')"
code = bodule('/foo.js', code, {
name: 'yourPackageName',
version : '0.1.0',
dependencies: {
'underscore': '1.4.4'
}
})
console.log(code)
/*
define('[email protected]/foo.js', ['[email protected]'], function (require, exports, module) {
var _ = require('underscore')
})
*/
安装
npm install bodule