Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cp-file

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cp-file - npm Package Compare versions

Comparing version 8.0.1 to 9.0.0

21

fs.js

@@ -12,3 +12,2 @@ 'use strict';

const chmod = promisify(fs.chmod);
const chown = promisify(fs.chown);

@@ -46,6 +45,2 @@ exports.closeSync = fs.closeSync.bind(fs);

exports.chown = (path, uid, gid) => chown(path, uid, gid).catch(error => {
throw new CpFileError(`chown \`${path}\` failed: ${error.message}`, error);
});
exports.statSync = path => {

@@ -67,18 +62,2 @@ try {

exports.chmodSync = (path, mode) => {
try {
return fs.chmodSync(path, mode);
} catch (error) {
throw new CpFileError(`chmod \`${path}\` failed: ${error.message}`, error);
}
};
exports.chownSync = (path, uid, gid) => {
try {
return fs.chownSync(path, uid, gid);
} catch (error) {
throw new CpFileError(`chown \`${path}\` failed: ${error.message}`, error);
}
};
exports.makeDir = path => makeDir(path, {fs}).catch(error => {

@@ -85,0 +64,0 @@ throw new CpFileError(`Cannot create directory \`${path}\`: ${error.message}`, error);

9

index.js

@@ -47,4 +47,3 @@ 'use strict';

fs.utimes(destination, stats.atime, stats.mtime),
fs.chmod(destination, stats.mode),
fs.chown(destination, stats.uid, stats.gid)
fs.chmod(destination, stats.mode)
]);

@@ -87,7 +86,2 @@ }

const fixupAttributes = (destination, stat) => {
fs.chmodSync(destination, stat.mode);
fs.chownSync(destination, stat.uid, stat.gid);
};
module.exports.sync = (source, destination, options) => {

@@ -119,3 +113,2 @@ if (!source || !destination) {

fs.utimesSync(destination, stat.atime, stat.mtime);
fixupAttributes(destination, stat);
};

6

package.json
{
"name": "cp-file",
"version": "8.0.1",
"version": "9.0.0",
"description": "Copy a file",

@@ -56,5 +56,5 @@ "license": "MIT",

"tsd": "^0.11.0",
"uuid": "^3.3.2",
"xo": "^0.26.1"
"uuid": "^7.0.2",
"xo": "^0.27.2"
}
}

@@ -11,2 +11,3 @@ # cp-file [![Build Status](https://travis-ci.org/sindresorhus/cp-file.svg?branch=master)](https://travis-ci.org/sindresorhus/cp-file) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/cp-file/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/cp-file?branch=master)

- Can be safe by turning off [overwriting](#optionsoverwrite).
- Preserves file mode, [but not ownership](https://github.com/sindresorhus/cp-file/issues/22#issuecomment-502079547).
- User-friendly errors.

@@ -13,0 +14,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc