Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@dashlane/dep-cache
Advanced tools
cache dependency manager installs to local machine - fork of npm-cache by swaraj - respects commandline args and deals with npm --production args etc.
this dep-cache is a fork of npm-cache from swarajban
dep-cache
is a command line utility that caches dependencies installed via npm
, bower
, jspm
, composer
and yarn
.
It is useful for build processes that run [npm|bower|composer|jspm|yarn] install
every time as part of their
build process. Since dependencies don't change often, this often means slower build times. dep-cache
helps alleviate this problem by caching previously installed dependencies on the build machine.
dep-cache
can be a drop-in replacement for any build script that runs [npm|bower|composer|jspm|yarn] install
.
When you run dep-cache install [npm|bower|jspm|composer|yarn]
, it first looks for package.json
, bower.json
,
composer.json
, yarn.lock
, etc. in the current working directory depending on which dependency manager is requested.
It then calculates the MD5 hash of the configuration file and looks for a filed named
.tar.gz in the cache directory ($HOME/.package_cache by default). If the file does not
exist, dep-cache
uses the system's installed dependency manager to install the dependencies. Once the
dependencies are installed, dep-cache
tars the newly downloaded dependencies and stores them in the
cache directory. The next time dep-cache
runs and sees the same config file, it will find the tarball
in the cache directory and untar the dependencies in the current working directory.
Upon installing cached dependencies, for npm & yarn, it launches "npm run prepublish" for npm <= 4 (starting npm 5, npm stop launching npm run prepublish upon npm install - to be followed up for yarn)
When storing the newly dependencies installed, dep-cache can perform a simple copy from the current project to the cache directory instead of creating a tar.gz
Used with the no archive feature, this feature provide the fastest npm install possible. When the dependencies have already been cached, it just creates a symbolic link from the current directory to the cached dependencies. For big project, copying all the dependencies from the cached folder, or unTARing the TARed dependencies can be time consuming
A reverse symbolic link can be created from the cached dependency folder to the current folder to mimic exactly the configuration of a normal npm install
Curtesy of Klaus Hougesen, dep-cache supports arg flowthrough and takes args into account when calculating hashes
Hash is created by globbing devdependencies, dependencies and installOptions. This can also be used to create
environment specific hash tarballs on a build server.
For instance
dep-cache install npm --production --bserver01
would create a different hash tarball than
dep-cache install npm --production --bserver02
npm install -g dep-cache
dep-cache install
To specify arguments to each dependency manager, add the arguments after listing the dependency manager.
For example, to install bower components with the --allow-root
option, and composer with the --dry-run
option:
dep-cache install bower --allow-root composer --dry-run
dep-cache install # try to install npm, bower, and composer components
dep-cache install bower # install only bower components
dep-cache install bower npm # install bower and npm components
dep-cache install --cleanOldCachedDepsSince 3 npm # clean cached dependency not used since 3 days and then install npm components
dep-cache install --cacheDirectory /home/cache/ bower # install components using /home/cache as cache directory
dep-cache install --forceRefresh bower # force installing dependencies from package manager without cache
dep-cache install --noArchive npm # do not compress/archive the cached dependencies
dep-cache install --useSymlink yarn # do not compress the cached dependencies, and when installing dependencies from cache, create a symlink instead of copying files
dep-cache install npm --production -msvs_version=2013 # add args to npm installer
dep-cache install npm --production -msvs_version=2013 bower --silent # add args to npm installer and bower
dep-cache clean # cleans out all cached files in cache directory
dep-cache clean --cleanOldCachedDepsSince 3 # cleans cached files in cache directory that are older than 3 days
dep-cache hash # reports the current working hash
Feel free to contribute and to submit PRs @ https://github.com/Dashlane/npm-cache
FAQs
cache dependency manager installs to local machine - fork of npm-cache by swaraj - respects commandline args and deals with npm --production args etc.
The npm package @dashlane/dep-cache receives a total of 5 weekly downloads. As such, @dashlane/dep-cache popularity was classified as not popular.
We found that @dashlane/dep-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.