https://github.com/primus/deumdify
Browserify plugin to expose a standalone bundle as a property of the global object.
https://github.com/primus/deumdify
Last synced: 11 months ago
JSON representation
Browserify plugin to expose a standalone bundle as a property of the global object.
- Host: GitHub
- URL: https://github.com/primus/deumdify
- Owner: primus
- License: mit
- Created: 2014-11-02T11:21:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-01-02T20:30:01.000Z (over 3 years ago)
- Last Synced: 2025-06-01T13:16:00.607Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 47.9 KB
- Stars: 15
- Watchers: 5
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deUMDify
[](https://www.npmjs.com/package/deumdify)[](https://github.com/primus/deumdify/actions?query=workflow%3ACI+branch%3Amaster)[](https://coveralls.io/r/primus/deumdify?branch=master)
This module is a [Browserify](http://browserify.org/) plugin that will expose a
standalone bundle as a property of the global object omitting AMD and CommonJS
support. The reason for this plugin is that Browserify does not give the ability
to generate a standalone bundle without a UMD wrapper.
## Install
```
npm install --save deumdify
```
## Usage
### Command Line
```sh
browserify main.js -s Foo -p deumdify > bundle.js
```
### API
Register the [plugin](https://github.com/substack/node-browserify#bpluginplugin-opts).
```js
'use strict';
var browserify = require('browserify')
, deumdify = require('deumdify')
, fs = require('fs');
var b = browserify({ entries: [ 'main.js' ], standalone: 'Foo' });
b.plugin(deumdify);
b.bundle().pipe(fs.createWriteStream('bundle.js'));
```
And that's it.
## License
[MIT](LICENSE)