Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
package-cleanup
Advanced tools
Package cleanup before deploy - delete or copy all unnecessary files by gitignore-like patterns
Command-line tool to delete all unnecessary files or copy necessary by gitignore-like patterns. If you need only to copy files use tartifacts instead.
Copy all js/css/images from '.' to 'frontend' dir:
$ cat .frontend-patterns
**/*.js
**/*.css
img/*.{jpg,png,svg}
$ ./node_modules/.bin/package-cleanup copy -p .frontend-patterns -o ./frontend
$ ls ./frontend
js/jquery/jq.min.js
js/jquery/jq.simple-slider.js
js/pages/all.js
all.css
img/img1.png
img/img2.svg
# or even archive all frontend files in tarball
$ ./node_modules/.bin/package-cleanup copy -p .frontend-patterns -o ./frontend-package.tar.gz
$ ls .
frontend-package.tar.gz
Delete all not python/ruby files in 'src':
$ cat .scripts-patterns
**/*.py
**/*.rb
# Don't keep tests
!**/test.{py,rb}
$ tree ./src
src
├── __init__.py
├── __init__.pyc
├── a_dir
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── configs.xml
│ └── some-other-dir
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── run.py
│ ├── run.rb
│ ├── secret.txt
│ ├── test.py
│ └── test.rb
└── b_dir
└── some-other-dir
├── data.json
├── data.py
└── data.pyc
4 directories, 15 files
$ ./node_modules/.bin/package-cleanup clean -p ../.scripts-pattern -w ./src
$ tree ./src
src
├── __init__.py
├── a_dir
│ ├── __init__.py
│ └── some-other-dir
│ ├── __init__.py
│ ├── run.py
│ └── run.rb
└── b_dir
└── some-other-dir
└── data.py
4 directories, 6 files
Package cleanup
Usage:
package-cleanup COMMAND [OPTIONS] [ARGS]
Commands:
clean : Cleanup package - delete all files matching to the patters
copy : Copy all files matching to the patterns to dir
Options:
-h, --help : Help
-v, --version : Version
-p PATTERNS, --patterns=PATTERNS : Path to file with patterns (required)
-w WORKINGDIR, --working-dir=WORKINGDIR : Working directory
Options for clean subcommand:
--delete-empty : Delete empty files
-d, --dry-run : Dry run
Options for copy subcommand:
-o OUTPUTDIR, --output-dir=OUTPUTDIR : Output dir, it can be dir or archive name(.tar or .tar.gz).
--not-copy-empty : Not copy empty files
FAQs
Package cleanup before deploy - delete or copy all unnecessary files by gitignore-like patterns
We found that package-cleanup 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.