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

cpr

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpr - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

24

lib/index.js

@@ -121,14 +121,16 @@ var fs = require('graceful-fs');

toFile = fs.createWriteStream(to),
bail;
bail,
onError = function (err) {
if (/EMFILE/.test(err)) {
bail = true;
setTimeout(function() {
copy(from, to, callback);
}, 50);
} else if (err) {
options.errors.push(err);
}
};
fromFile.on('error', function (err) {
if (/EMFILE/.test(err)) {
bail = true;
setTimeout(function() {
copy(from, to, callback);
}, 50);
} else if (err) {
options.errors.push(err);
}
});
fromFile.on('error', onError);
toFile.on('error', onError);
fromFile.pipe(toFile);

@@ -135,0 +137,0 @@ fromFile.once('end', function() {

@@ -5,3 +5,3 @@ {

"author": "Dav Glass <davglass@gmail.com>",
"version": "0.0.1",
"version": "0.0.2",
"dependencies": {

@@ -14,2 +14,3 @@ "graceful-fs": "~1.1.14",

"devDependencies": {
"jshint": "~0.9.1",
"yui-lint": "~0.1.0",

@@ -16,0 +17,0 @@ "vows": "*"

@@ -16,2 +16,7 @@ CPR (cp -R)

Build Status
------------
[![Build Status](https://secure.travis-ci.org/davglass/cpr.png)](http://travis-ci.org/davglass/cpr)
Usage

@@ -18,0 +23,0 @@ -----

@@ -37,5 +37,7 @@ var vows = require('vows'),

},
'has ./out': function(topic) {
'has ./out/0': function(topic) {
var stat = fs.statSync(this.outDir);
assert.ok(stat.isDirectory());
},
'and dirs are equal': function(topic) {
assert.deepEqual(topic.dirs.to, topic.dirs.from);

@@ -74,5 +76,8 @@ },

},
'has ./out': function(topic) {
'does not have ./out/1': function(topic) {
assert.ok(topic.stat); //Should be an error
},
'and threw an error': function(topic) {
assert.ok(topic.err); //Should be an error
assert.ok(topic.stat); //Should be an error
assert.equal(topic.err, 'no files to copy');
}

@@ -99,3 +104,3 @@ },

},
'and has ./out': function(topic) {
'and has ./out/2': function(topic) {
var stat = fs.statSync(this.outDir);

@@ -141,3 +146,3 @@ assert.ok(stat.isDirectory());

},
'and has ./out': function(topic) {
'and has ./out/3': function(topic) {
var stat = fs.statSync(this.outDir);

@@ -165,2 +170,2 @@ assert.ok(stat.isDirectory());

vows.describe('full').addBatch(tests).export(module);
vows.describe('CPR Tests').addBatch(tests).export(module);
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