Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
There are other modules out there that attempt this, but none did it the way I needed it to be done or they had issues and the author failed to fix them in a timely manner.
npm install cpr
var cpr = require('cpr');
//or
var cpr = require('cpr').cpr; //Back compat
cpr('/path/from', '/path/to', {
deleteFirst: true, //Delete "to" before
overwrite: true, //If the file exists, overwrite it
confirm: true //After the copy, stat all the copied files to make sure they are there
}, function(err, files) {
//err - The error if any (err.list might be available with an array of errors for more detailed information)
//files - List of files that we copied
});
cpr('/path/from', '/path/to', function(err, files) {
//err - The error if any (err.list might be available with an array of errors for more detailed information)
//files - List of files that we copied
});
deleteFirst
: Delete the to directory with rimraf
overwrite
: If the destination exists, overwrite itconfirm
: After the copy operation, stat all the files and report errors if any are missingfilter
: RegExp
or function
to test each file against before copyingIf you give it a RegExp
, it will use that to test
the filename as they are being gathered. If it passes, it will be removed.
If you give it a function
, it will use that with Array.filter
on the list of files.
FAQs
cp -R
The npm package cpr receives a total of 61,465 weekly downloads. As such, cpr popularity was classified as popular.
We found that cpr 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.