https://github.com/jamen/pull-browserify
Browserify functions for pull stream
https://github.com/jamen/pull-browserify
Last synced: about 1 year ago
JSON representation
Browserify functions for pull stream
- Host: GitHub
- URL: https://github.com/jamen/pull-browserify
- Owner: jamen
- License: mit
- Created: 2017-01-24T16:20:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T17:30:16.000Z (over 9 years ago)
- Last Synced: 2024-04-24T00:40:35.953Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# pull-browserify
> Browserify functions for pull stream
This simply wraps [`browserify`](https://npmjs.com/browserify) in pull-stream functions.
```js
var pull = require('pull-stream')
var vinyl = require('pull-vinyl')
var b = require('pull-browserify')
pull(
b.source('some-file.js'),
b.add('another-file.js'),
b.transform('babelify', { ...opts }),
b.bundle(),
vinyl.map('index.js'),
vinyl.write('out')
)
```
## Installation
```sh
$ npm install --save pull-browserify
```
## Usage
### `browserify([files, opts])`
### `browserify.source([files, opts])`
Creates a browserify object in the pipeline, where you can use the functions (or `pull.through`) to manage it.
### `browserify.{add, require, external, ignore, exclude, transform}`
These just wrap their [`browserify`](https://npmjs.com/browserify) counterparts in `pull.through`. You can read the docs there.
```js
var settings = pull(
browserify.add('./some-shim.js')
browserify.transform('babelify', { ...opts }),
browserify.exclude('./other-file.js'),
// ...
)
pull(
browserify('./app/index.js'),
settings,
browserify.bundle(),
// ...
)
```
### `browserify.bundle()`
Maps the stream to the bundled source buffer. You can write it to the file system or do whatever.
```js
pull(
// ... after sourcing and adding settings
browserify.bundle(),
vinyl.map('index.js'),
vinyl.write('out')
)
```
## License
MIT © [Jamen Marz](https://git.io/jamen)
---
[][package] [](https://travis-ci.org/jamen/pull-browserify) [][package] [][package] [](https://paypal.me/jamenmarz/5usd) [](https://github.com/jamen)
[package]: https://npmjs.org/package/pull-browserify