browserify-umdify
This module constructs a UMD module from a Browserify CommonJS module
Last updated 2 years ago by hardeep .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install browserify-umdify 
SYNC missed versions from official npm registry.

Browserify UMDify

Slack Status Dependency Status npm version

This module takes a Browserify CommonJS module and turns it into an UMD compatible module.

if modules are exported with browserify using the --require switch they'll also be exported via this module.

Using the module via command line

For example:

browserify -r shortid -r my-module:my-module.js -o build.js

cat build.js | node ./bin/cmd.js > umd-build.js

Then the following will work:

CommonJS

var bundle = require('./umd-build.js');
console.log(bundle);

AMD

define(['./umd-build.js'], function(bundle) {
    console.log(bundle);
});

Browser without a module loader

<script src="umd-build.js"></script>
<script>
    console.log(window.myModule);
</script>

Using the module in code

var BrowserifyUmdify = require('browserify-umdify');
var umd = new BrowserifyUmdify();

process.stdin
    .pipe(umd)
    .pipe(process.stdout);

License

The MIT License (MIT)

Copyright (c) 2015 Xiroji Systems Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 1.0.4                                ...           latest (2 years ago)

4 Versions

  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 4
Dependencies (2)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |