New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 9.0.0 to 9.1.0

6

fs.js

@@ -60,9 +60,9 @@ 'use strict';

exports.makeDir = path => makeDir(path, {fs}).catch(error => {
exports.makeDir = (path, options) => makeDir(path, {...options, fs}).catch(error => {
throw new CpFileError(`Cannot create directory \`${path}\`: ${error.message}`, error);
});
exports.makeDirSync = path => {
exports.makeDirSync = (path, options) => {
try {
makeDir.sync(path, {fs});
makeDir.sync(path, {...options, fs});
} catch (error) {

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

@@ -9,2 +9,11 @@ declare namespace cpFile {

readonly overwrite?: boolean;
/**
[Permissions](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation) for created directories.
It has no effect on Windows.
@default 0o777
*/
readonly directoryMode?: number;
}

@@ -11,0 +20,0 @@

@@ -15,3 +15,3 @@ 'use strict';

const readStream = await fs.createReadStream(source);
await fs.makeDir(path.dirname(destination));
await fs.makeDir(path.dirname(destination), {mode: options.directoryMode});
const writeStream = fs.createWriteStream(destination, {flags: options.overwrite ? 'w' : 'wx'});

@@ -98,3 +98,3 @@

checkSourceIsFile(stat, source);
fs.makeDirSync(path.dirname(destination));
fs.makeDirSync(path.dirname(destination), {mode: options.directoryMode});

@@ -101,0 +101,0 @@ const flags = options.overwrite ? null : fsConstants.COPYFILE_EXCL;

{
"name": "cp-file",
"version": "9.0.0",
"version": "9.1.0",
"description": "Copy a file",

@@ -57,4 +57,9 @@ "license": "MIT",

"uuid": "^7.0.2",
"xo": "^0.27.2"
"xo": "^0.28.2"
},
"xo": {
"rules": {
"unicorn/string-content": "off"
}
}
}

@@ -1,2 +0,2 @@

# 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)
# cp-file

@@ -62,2 +62,11 @@ > Copy a file

##### directoryMode
Type: `number`\
Default: `0o777`
[Permissions](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation) for created directories.
It has no effect on Windows.
### cpFile.on('progress', handler)

@@ -64,0 +73,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