Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@retailmenot/grunt-orphans
Advanced tools
Grunt multi-task for discovering orphaned files in a JS directory.
Grunt multi-task for discovering orphaned files in a JS directory.
This task is designed to help you identify unused files that exist in a project's JS directories; files that are no longer referenced as dependencies by your entrypoints, but remain in the filesystem.
npm install --save-dev grunt @retailmenot/grunt-orphans
In your Gruntfile:
orphans: {
options: {
// List of file extensions you want to consider
// when discovering orphans
fileExtensions: ['.js', '.hbs'],
// List of files, that, even if detected as orphans
// will not result in the task failing. Useful if you
// reference or use some files in your app that are
// not dependencies of your greater JS build.
whitelist: [
// do not complain if
'scripts/third-party/**/*.js'
]
},
main: {
options: {
// Path to your webpack.config.js (optional).
// This will help madge with path resolution
// and module aliasing as it walks your dependencies
webpackConfig: 'path/to/webpack.config.js',
// The directory from which module references
// in your codebase are relative.
baseDir: 'scripts/',
// Glob for all of the files that should be
// treated as entrypoints and serve as the
// starting point for madge to discover your
// codebase's dependencies.
entryFileGlob: 'scripts/pages/*.js'
},
// Tells the task the list of files to look at. It will
// complain about any files specified in this array that
// are not in the dependency tree for any files matching
// options.entryFileGlob.
files: {
expand: true,
cwd: 'scripts',
src: ['**/*.js', '**/*.hbs']
}
}
}
# create an orphaned file in your scripts directory
$ touch scripts/orphan.js
$ grunt orphans
Running "orphans:main" (orphans) task
>> Oprhaned file: scripts/orphan.js
Warning: Found 1 orphaned files. Use --force to continue.
Aborted due to warnings.
# Remove the script
$ rm scripts/orphan.js
$ grunt orphans
Running "orphans:main" (orphans) task
Done.
FAQs
Grunt multi-task for discovering orphaned files in a JS directory.
We found that @retailmenot/grunt-orphans demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.