
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
ouanalyse-gulp-main-npm-files
Advanced tools
To install this module, you need to run the following command
$ npm install gulp-main-npm-files
var mainNpmFiles = require('gulp-main-npm-files');
var files = mainNpmFiles([[filter, ]options][, callback]);
This will read your package.json, iterate through your dependencies and returns an array of files defined in the main property of the packages package.json.
var gulp = require('gulp');
var mainNpmFiles = require('gulp-main-npm-files');
gulp.task('TASKNAME', function() {
return gulp.src(mainNpmFiles())
.pipe(/* what you want to do with the files */)
});
The module accepts the following options:
var gmnf = require('gulp-main-npm-files');
gulp.task('vendor-js', function() {
gulp.src(gmnf({
override: {
'bootstrap': {
'main' : 'dist/js/bootstrap.js'
}
}
}), {base:'./'})
.pipe(flatten())
.pipe(gulp.dest('./web/js/libs-gen'));
})
var mainNpmFiles = require('gulp-main-npm-files');
// Copy dependencies from ./node_modules to build/node_modules/
gulp.task('copyNpmDependencies', function() {
gulp.src(mainNpmFiles(), { base:'./' })
.pipe(gulp.dest('./build'));
});
var mainNpmFiles = require('gulp-main-npm-files');
// Copy dependencies from ./path/node_modules to build/node_modules/
gulp.task('copyNpmDependencies', function() {
gulp.src(mainNpmFiles({ nodeModulesPath: "./path/node_modules" }), { base:'./' })
.pipe(gulp.dest('./build'));
});
var mainNpmFiles = require('gulp-main-npm-files');
// Copy dependencies present in ./package.jon to build/node_modules/
gulp.task('copyNpmDependencies', function() {
gulp.src(mainNpmFiles(), { base:'./' })
.pipe(gulp.dest('./build'));
});
var mainNpmFiles = require('gulp-main-npm-files');
// Copy dependencies present in ./path/package.json to build/node_modules/
gulp.task('copyNpmDependencies', function() {
gulp.src(mainNpmFiles({ packageJsonPath: "path/package.json" }), { base:'./' })
.pipe(gulp.dest('./build'));
});
var mainNpmFiles = require('gulp-main-npm-files');
// Copy dependencies to build/node_modules/
gulp.task('copyNpmDependencies', function() {
gulp.src(mainNpmFiles(), { base:'./' })
.pipe(gulp.dest('./build'));
});
var mainNpmFiles = require('gulp-main-npm-files');
// Copy dev dependencies and dependencies to build/node_modules/
gulp.task('copyNpmDependencies', function() {
gulp.src(mainNpmFiles({ devDependencies: true }), { base:'./' })
.pipe(gulp.dest('./build'));
});
Don't hesitate to send me any recommendations, suggestions about this project. I really want to have some returns about does it work well, does it match user expectation, etc.
You can send me any issues you want or contact me to my github email and put the repository name in the subject.
FAQs
Finds main scripts of node modules
We found that ouanalyse-gulp-main-npm-files demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.