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

  • 0.3.0
  • Source
  • npm
  • Socket score

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

gulp-derequire

NPM version Build Status Dependency Status

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({
            tokenTo:   '_dereq_',
            tokenFrom: 'require'
        }))
        .pipe(gulp.dest('./build'));
});

API

derequire(options)

Note: According to the derequire README, the token you're changing from and the token you're changing to need to be the same length.

options.tokenFrom

Type: String Default value: 'require'

Target identifier to replace from.

options.tokenTo

Type: String Default value: '_dereq_'

Identifier to replace to.

Author

License

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 26 Jul 2014

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