New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-derequire

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-derequire

A Gulp plugin to apply derequire to target Buffer/Stream

  • 2.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
884
decreased by-11.86%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-derequire

Build Status NPM version License

A gulp plugin for derequire.

Description

gulp-derequire is a gulp plugin to apply derequire to target Buffer/Stream. It's useful when you are building standalone module using browserify with gulp.

Usage

First, install gulp-derequire as a development dependency:

npm install --save-dev gulp-derequire

Then, add it to your gulpfile.js:

var derequire = require('gulp-derequire');
var browserify = require('browserify');
var source = require('vinyl-source-stream');

gulp.task('build', function() {
    var bundleStream = browserify({entries: './index.js', standalone: 'yourModule'}).bundle();
    return bundleStream
        .pipe(source('yourModule.js'))
        .pipe(derequire())
        .pipe(gulp.dest('./build'));
});

API

derequire(parameters)

Note: parameters are passed verbatim to derequire so see its readme for options

customization example

to change both require and define

var derequire = require('gulp-derequire');
var browserify = require('browserify');
var source = require('vinyl-source-stream');

gulp.task('build', function() {
    var bundleStream = browserify({entries: './index.js', standalone: 'yourModule'}).bundle();
    return bundleStream
        .pipe(source('yourModule.js'))
        .pipe(derequire([
            {
                from: 'require',
                to: '_dereq_'
            },
            {
                from: 'define',
                to: '_defi_'
            }
        ]))
        .pipe(gulp.dest('./build'));
});

Author

License

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 14 Apr 2020

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