Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-browserify-watchify-glob

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-browserify-watchify-glob

Create a Browserify bundler with multiple entries based on a glob pattern. Rebuild incrementally watching for changes, including additions and deletions of files that match the glob pattern.

  • 1.0.0-1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-browserify-watchify-glob

Create a Browserify bundler with multiple entries based on a glob pattern. Rebuild incrementally watching for changes, including additions and deletions of files that match the glob pattern.

Quickstart

npm i gulp-browserify-watchify-glob -D
# or
yarn add gulp-browserify-watchify-glob --dev
import globbedBrowserify from 'gulp-browserify-watchify-glob';
// or
const globbedBrowserify = require('gulp-browserify-watchify-glob');

// Use as a drop-in replacement for browserify.
const unittestBundler = globbedBrowserify({
    entries: 'src/**/*-test.js',
    debug: true,
    // cache and packageCache default to {}
}).transform(/* whatever */);

// Something you want to do at least once, but maybe multiple times
// with the same bundler.
export function runTests() {
    return unittestBundler.bundle().pipe(/* whatever */);
}

// Keep track of file changes, file additions and file deletions.
export function watch() {
    // Tell the bundler that you want to runTests on changes to any
    // file that matches the glob pattern.
    const startWatchingTests = unittestBundler.watch(runTests);
    // startWatchingTests is a task that wraps runTests. 
    startWatchingTests();
    // Magic is now happening: runTests will run again when you add,
    // modify or delete a file that matches the glob pattern.

    // Shorthand for the above, if you don't need to combine the
    // startWatchingTests task in a gulp.series or a gulp.parallel.
    unittestBundler.watch(runTests)();

    // Maybe you want to kick off with a different task than the one
    // you'll be running on every change.
    const wrapsKickoff = unittestBundler.watch(runTests, kickoff);
    wrapsKickoff();
    // This works as long as kickoff calls unittestBundler.bundle().
}

Caveats

  • This is prerelease software. It was extracted from a gulpfile and has been field-tested, but there are no unittests yet.
  • Browserify was not designed with this use case in mind. I rely on browserify implementation details in order to make the magic work.

FAQs

Package last updated on 26 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc