New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rightclick

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rightclick - npm Package Compare versions

Comparing version 0.4.4 to 0.5.0

4

changelog.md
# rightClick Changelog
### 28 March 2014, 0.5.0
* Paste now accepts optional force argument
### 28 March 2014, 0.4.4

@@ -4,0 +8,0 @@

8

lib/paste.js

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

module.exports = function (target) {
module.exports = function (target, force) {
var check = function (target) {
if (fs.existsSync(target)) {
if (!force && fs.existsSync(target)) {

@@ -37,3 +37,5 @@ log.error(target + ' already exists.');

fs.mkdirSync(newTarget);
if (!fs.existsSync(newTarget)) {
fs.mkdirSync(newTarget);
}

@@ -40,0 +42,0 @@ paste(newTarget, clip[item]);

{
"name": "rightclick",
"description": "Cut, copy, paste and delete for node.js",
"version": "0.4.4",
"version": "0.5.0",
"keywords": [

@@ -6,0 +6,0 @@ "cut",

@@ -60,2 +60,6 @@ # rightClick [![Build Status](https://secure.travis-ci.org/mattyod/rightClick.png)](http://travis-ci.org/mattyod/rightClick)

As of version 0.5.0 paste now accepts an optional force boolean. This will allow you to paste over existing folders. i.e.
rightClick('./myParentFolder').copy('myFolder').paste('myNewDestination', true);
### del()

@@ -62,0 +66,0 @@

@@ -63,3 +63,3 @@ // Helper modules

paste: function (test) {
test.expect(8);
test.expect(11);

@@ -93,2 +93,40 @@ // Call tested method.

// Redefining rightClick clipboard for force
this.rightClick = function () {
this.clipboard = {
target: '',
files: {
'file.txt': 'foo',
'deep': {
'file.txt': 'bar',
'deeper': {
'file.txt': 'baz'
}
}
}
};
// The tested module.
this.paste = require('../lib/paste');
return this;
};
// Call tested method with force.
this.rightClick().paste('./test/sandbox/paste', true);
test.strictEqual(fs.readFileSync(unPrepObject[0], 'binary'), 'baz',
'file.txt has been over written with force');
test.strictEqual(fs.readFileSync(unPrepObject[2], 'binary'), 'bar',
'deep/file.txt has been over written with force');
test.strictEqual(fs.readFileSync(unPrepObject[4], 'binary'), 'foo',
'deep/deeper/file.txt been over written with force');
test.done();

@@ -95,0 +133,0 @@

Sorry, the diff of this file is not supported yet

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