Socket
Book a DemoInstallSign in
Socket

gulp-require-modules

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-require-modules

move required modules in node_modules to a new folder

latest
Source
npmnpm
Version
1.1.4
Version published
Weekly downloads
78
14.71%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-require-modules

move required modules in node_modules to a new folder.

Install

$ npm install --save-dev gulp-require-modules

Usage

no replace

var gulp = require('gulp');
var requireModules = require('gulp-require-modules');

gulp.task('default', function () {
    return gulp.src('src/*.js')
        .pipe(requireModules({dist: false}))
        .pipe(gulp.dest());
});

this will:

  • copy required modules in node_modules to dist/npm
  • save manifest to file dist/require-modules.json

replace

var gulp = require('gulp');
var requireModules = require('gulp-require-modules');
var dist = 'dist';
gulp.task('default', function () {
    return gulp.src('src/*.js')
        .pipe(requireModules({dist: true, fromDirectory:'src', distDirectory: dist}))
        .pipe(gulp.dest(dist));
});

this will:

  • copy required modules in node_modules to dist/node_modules
  • save manifest to file dist/require-modules.json
  • replace require(modules) to require('./npm/module/index.js').

API

requireModules([options])

options

modulesDirectory: string Default: 'dist/node_modules'

the new directory for modules

modulesManifestPath: string Default: 'dist/require-modules.json'

path of manifest file

dist: boolean Default: true

whether the requires in the file will be modified to new path.

distDirectory: string Default: 'dist'

the directory where input file will be disted to. if null, the requires of the file will not be modified.

fromDirectory: string Default: 'src'

the directory where input file is from. if null, use process.cwd

Require

support

  • require('module')
  • require('./module/file')
  • require('./module/file.js')
  • require('./module/folder')
  • require('readable-stream/transform')

Keywords

gulpplugin

FAQs

Package last updated on 22 Feb 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.