watchify / 3.7.0 last updated 2 months ago created on May 30th 2013
Install
npm install --save watchify
Clone
git clone git@github.com:substack/watchify.git
dependencies
show all 305
| main |
|
anymatch | 1.3.0 | ISC |
|
|
browserify | 13.0.0 | MIT | |
|
|
defined | 1.0.0 | MIT | |
|
|
outpipe | 1.1.1 | MIT | |
|
|
through2 | 2.0.1 | MIT |
maintainers
versions
64 total
| 3.7.0 | 2 months ago | feross |
| 3.6.1 | 4 months ago | zertosh |
| 3.6.0 | 5 months ago | zertosh |
| 3.5.0 | 5 months ago | zertosh |
| 3.4.0 | 6 months ago | zertosh |
| 3.3.1 | 7 months ago | substack |
| 3.3.0 | 8 months ago | zertosh |
| 3.2.3 | 9 months ago | zertosh |
| 3.2.2 | 9 months ago | zertosh |
| 3.2.1 | 10 months ago | zertosh |
| 3.2.0 | a year ago | zertosh |
| 3.1.2 | a year ago | substack |
| 3.1.1 | a year ago | zertosh |
| 3.1.0 | a year ago | zertosh |
| 3.0.1 | a year ago | zertosh |
| 3.0.0 | a year ago | zertosh |
| 2.6.2 | a year ago | zertosh |
| 2.6.1 | a year ago | substack |
| 2.6.0 | a year ago | zertosh |
| 2.5.0 | a year ago | substack |
| 2.4.0 | a year ago | substack |
| 2.3.0 | a year ago | substack |
| 2.2.1 | a year ago | substack |
| 2.2.0 | a year ago | substack |
| 2.1.1 | a year ago | substack |
| 2.1.0 | a year ago | substack |
| 2.0.0 | a year ago | substack |
| 1.0.6 | a year ago | substack |
| 1.0.5 | a year ago | substack |
| 1.0.4 | a year ago | substack |
| 1.0.3 | a year ago | substack |
| 1.0.2 | 2 years ago | substack |
| 1.0.1 | 2 years ago | substack |
| 1.0.0 | 2 years ago | substack |
| 0.10.2 | 2 years ago | substack |
| 0.10.1 | 2 years ago | substack |
| 0.10.0 | 2 years ago | substack |
| 0.9.0 | 2 years ago | substack |
| 0.8.3 | 2 years ago | substack |
| 0.8.2 | 2 years ago | substack |
| 0.8.1 | 2 years ago | substack |
| 0.8.0 | 2 years ago | substack |
| 0.7.2 | 2 years ago | substack |
| 0.7.1 | 2 years ago | substack |
| 0.7.0 | 2 years ago | substack |
| 0.6.4 | 2 years ago | substack |
| 0.6.3 | 2 years ago | substack |
| 0.6.2 | 2 years ago | substack |
| 0.6.1 | 2 years ago | substack |
| 0.6.0 | 2 years ago | substack |
| 0.5.6 | 2 years ago | substack |
| 0.5.5 | 2 years ago | substack |
| 0.5.4 | 2 years ago | substack |
| 0.5.3 | 2 years ago | substack |
| 0.5.2 | 2 years ago | substack |
| 0.5.1 | 2 years ago | substack |
| 0.5.0 | 2 years ago | substack |
| 0.4.1 | 2 years ago | substack |
| 0.4.0 | 2 years ago | substack |
| 0.3.0 | 2 years ago | substack |
| 0.2.0 | 2 years ago | substack |
| 0.1.0 | 3 years ago | substack |
| 0.0.1 | 3 years ago | substack |
| 0.0.0 | 3 years ago | substack |
readme
watchify
watch mode for browserify builds
Update any source file and your browserify bundle will be recompiled on the spot.
example
Now as you update files, static/bundle.js will be automatically
incrementally rebuilt on the fly.
The -o option can be a file or a shell command (not available on Windows)
that receives piped input:
You can use -v to get more verbose output to show when a file was written and how long the bundling took (in seconds):
usage
Use watchify with all the same options as browserify except that -o (or
--outfile) is mandatory. Additionally, there are also:
methods
watchify(b, opts)
watchify is a browserify plugin, so it can be applied like any other plugin.
However, when creating the browserify instance b, you MUST set the cache
and packageCache properties:
By default, watchify doesn't display any output, see events for more info.
b continues to behave like a browserify instance except that it caches file
contents and emits an 'update' event when a file changes. You should call
b.bundle() after the 'update' event fires to generate a new bundle.
Calling b.bundle() extra times past the first time will be much faster due
to caching.
Important: Watchify will not emit 'update' events until you've called
w.bundle() once and completely drained the stream it returns.
options
You can to pass an additional options object as a second parameter of watchify. Its properties are:
opts.delay is the amount of time in milliseconds to wait before emitting
an "update" event after a change. Defaults to 100.
opts.ignoreWatch ignores monitoring files for changes. If set to true,
then **/node_modules/** will be ignored. For other possible values see
Chokidar's documentation on "ignored".
opts.poll enables polling to monitor for changes. If set to true, then
a polling interval of 100ms is used. If set to a number, then that amount of
milliseconds will be the polling interval. For more info see Chokidar's
documentation on
"usePolling" and "interval".
This option is useful if you're watching an NFS volume.
b.close()
Close all the open watch handles.
events
b.on('update', function (ids) {})
When the bundle changes, emit the array of bundle ids that changed.
b.on('bytes', function (bytes) {})
When a bundle is generated, this event fires with the number of bytes.
b.on('time', function (time) {})
When a bundle is generated, this event fires with the time it took to create the bundle in milliseconds.
b.on('log', function (msg) {})
This event fires after a bundle was created with messages of the form:
with the number of bytes in the bundle X and the time in seconds Y.
install
With npm do:
to get the watchify command and:
to get just the library.
troubleshooting
rebuilds on OS X never trigger
It may be related to a bug in fsevents (see #250
and stackoverflow).
Try the --poll flag
and/or renaming the project's directory - that might help.
license
MIT
