bodule
a tool for wrapping commonjs to browser !
Last updated 7 years ago by island205 .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install bodule 
SYNC missed versions from official npm registry.

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('yourPackageName@0.1.0/foo.js', ['underscore@1.4.4'], function (require, exports, module) {
    var _ = require('underscore')
})
*/

安装

npm install bodule

Current Tags

  • 0.1.0                                ...           latest (7 years ago)

1 Versions

  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |