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 5.0.0 to 6.0.0

6

fs.js

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

read.on('error', err => {
read.once('error', err => {
reject(new CpFileError(`Cannot read from \`${path}\`: ${err.message}`, err));
});
read.on('readable', () => {
read.once('readable', () => {
resolve(read);
});
read.on('end', () => {
read.once('end', () => {
resolve(read);

@@ -26,0 +26,0 @@ });

'use strict';
const path = require('path');
const fsConstants = require('fs').constants;
const Buffer = require('safe-buffer').Buffer;
const {Buffer} = require('safe-buffer');
const CpFileError = require('./cp-file-error');

@@ -58,4 +58,4 @@ const fs = require('./fs');

promise.on = function () {
progressEmitter.on.apply(progressEmitter, arguments);
promise.on = (...args) => {
progressEmitter.on(...args);
return promise;

@@ -62,0 +62,0 @@ };

{
"name": "cp-file",
"version": "5.0.0",
"description": "Copy a file",
"license": "MIT",
"repository": "sindresorhus/cp-file",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"maintainers": [
{
"name": "Michael Mayer",
"email": "michael@schnittstabil.de",
"url": "schnittstabil.de"
}
],
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && nyc ava"
},
"files": [
"cp-file-error.js",
"fs.js",
"index.js",
"progress-emitter.js"
],
"keywords": [
"copy",
"cp",
"file",
"clone",
"fs",
"stream",
"file-system",
"ncp",
"fast",
"quick",
"data",
"content",
"contents"
],
"dependencies": {
"graceful-fs": "^4.1.2",
"make-dir": "^1.0.0",
"nested-error-stacks": "^2.0.0",
"pify": "^3.0.0",
"safe-buffer": "^5.0.1"
},
"devDependencies": {
"ava": "*",
"clear-module": "^2.1.0",
"coveralls": "^2.11.14",
"del": "^3.0.0",
"import-fresh": "^2.0.0",
"nyc": "^11.2.1",
"sinon": "^3.2.1",
"uuid": "^3.0.0",
"xo": "*"
}
"name": "cp-file",
"version": "6.0.0",
"description": "Copy a file",
"license": "MIT",
"repository": "sindresorhus/cp-file",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"maintainers": [
{
"name": "Michael Mayer",
"email": "michael@schnittstabil.de",
"url": "schnittstabil.de"
}
],
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && nyc ava"
},
"files": [
"cp-file-error.js",
"fs.js",
"index.js",
"progress-emitter.js"
],
"keywords": [
"copy",
"cp",
"file",
"clone",
"fs",
"stream",
"file-system",
"ncp",
"fast",
"quick",
"data",
"content",
"contents"
],
"dependencies": {
"graceful-fs": "^4.1.2",
"make-dir": "^1.0.0",
"nested-error-stacks": "^2.0.0",
"pify": "^3.0.0",
"safe-buffer": "^5.0.1"
},
"devDependencies": {
"ava": "*",
"clear-module": "^2.1.0",
"coveralls": "^3.0.0",
"del": "^3.0.0",
"import-fresh": "^2.0.0",
"nyc": "^11.2.1",
"sinon": "^5.0.0",
"uuid": "^3.0.0",
"xo": "*"
}
}

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

emitProgress() {
const size = this.size;
const written = this.written;
const {size, written} = this;
this.emit('progress', {

@@ -27,0 +26,0 @@ src: this.src,

@@ -27,5 +27,6 @@ # 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)

cpFile('src/unicorn.png', 'dist/unicorn.png').then(() => {
(async () => {
await cpFile('src/unicorn.png', 'dist/unicorn.png');
console.log('File copied');
});
})();
```

@@ -96,7 +97,7 @@

```js
cpFile(src, dest).on('progress', data => {
// ...
}).then(() => {
// ...
})
(async () => {
await cpFile(src, dest).on('progress', data => {
// …
});
})();
```

@@ -107,3 +108,6 @@

See [cpy](https://github.com/sindresorhus/cpy) if you need to copy multiple files or want a CLI.
- [cpy](https://github.com/sindresorhus/cpy) - Copy files
- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line
- [move-file](https://github.com/sindresorhus/move-file) - Move a file
- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed

@@ -110,0 +114,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