
Security News
Lovable’s OJ Rewrites Vite’s Dev Server in Rust as AI Lowers the Cost of Forking Open Source
Lovable’s OJ rewrites Vite’s dev server in Rust, reducing memory use and preview times as AI lowers the cost of open source reimplementation.
Functionality ( and README ) heavily inspired by ck86's main-bower-files
var mainNPMFiles = require('npmfiles');
var files = mainNPMFiles([options]);
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.
You can override the behavior if you add an overrides property to your own package.json.
var gulp = require('gulp');
var mainNPMFiles = require('npmfiles');
gulp.task('TASKNAME', function() {
return gulp.src(mainNPMFiles())
.pipe(/* what you want to do with the files */)
});
These options can be set directly in your package.json file, e.g.:
{
"name": "your-package-name",
"dependencies": {
"NPM-PACKAGE": "*"
},
"overrides": {
"NPM-PACKAGE": {
"main": [
// Here you can override the main files or ignoring this package, for more info see options
]
}
}
}
Type: String or Array
You can specify which files should be selected. e.g.:
You can also use glob pattern to select files, e.g.:
{
"overrides": {
"NPM-PACKAGE": {
"main": "**/*.js"
}
}
}
Type: Boolean Default: false
Set to true if you want to ignore this package.
These options can be passed to this plugin, e.g: mainNPMFiles(/* options*/)
Type: String
You can specify the node_modules folder path where the modules are located.
For example:
mainNPMFiles({
nodeModulesPath: 'path/for/node_modules'
})
.pipe(gulp.dest('client/src/lib'));
Type: String
You can specify the package.json file path.
For example:
mainNPMFiles({
packageJsonPath: 'path/for/package.json'
})
.pipe(gulp.dest('client/src/lib'));
Type: Boolean Default: false
Set this option to true to add the devDependencies to your dependencies
(MIT License)
Copyright (c) 2017 Cosmin Lupu
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Get all main files for your project's NPM modules
The npm package npmfiles receives a total of 614 weekly downloads. As such, npmfiles popularity was classified as not popular.
We found that npmfiles 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.

Security News
Lovable’s OJ rewrites Vite’s dev server in Rust, reducing memory use and preview times as AI lowers the cost of open source reimplementation.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.