Skip to content

Commit

Permalink
Added optional encoding argument for Copy.
Browse files Browse the repository at this point in the history
Bump to 0.0.4
  • Loading branch information
mattyod committed Mar 7, 2014
1 parent 0c67c69 commit 62b67c9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -13,6 +13,12 @@ with file systems in a programatic way. Namely cut, copy, paste & delete.

## API

### rightClick()

Select root folder for copy and cut operations and optionally determine encoding for copy.

rightClick('./', 'utf8');

### cut()

To deep cut from the file system use:
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
@@ -1,5 +1,9 @@
# rightClick Changelog

### 7 March 2014, 0.4.0

* Accepts optional argument of encoding type for copy to clipboard

### 13 November 2013, 0.3.0

* Added tap method allowing interception of chain
Expand Down
5 changes: 3 additions & 2 deletions lib/copy.js
Expand Up @@ -15,7 +15,8 @@ module.exports = function (path) {

path.forEach(function (path) {

var fullPath = this.clipboard.target + sep + path;
var fullPath = this.clipboard.target + sep + path,
encoding = this.encoding;

var copy = function (fullPath, path, clip) {

Expand All @@ -39,7 +40,7 @@ module.exports = function (path) {
} else {

// Copy file content to clipboard.
clip[path] = fs.readFileSync(fullPath);
clip[path] = fs.readFileSync(fullPath, encoding);

}

Expand Down
14 changes: 6 additions & 8 deletions package.json
@@ -1,12 +1,13 @@
{
"name": "rightclick",
"description": "Cut, copy, paste and delete for node.js",
"version": "0.3.0",
"version": "0.4.0",
"keywords": [
"cut",
"copy",
"paste",
"delete"
"delete",
"tap"
],
"author": {
"name": "Matthew O'Donoghue"
Expand All @@ -20,16 +21,13 @@
"url": "https://github.com/mattyod/rightclick/issues"
},
"dependencies": {
"col": "*",
"underscore": "1.5.2"
"col": "0.0.4",
"underscore": "1.6.0"
},
"devDependencies": {
"nodeunit": "0.8.2"
"nodeunit": "0.8.6"
},
"scripts": {
"test": "nodeunit test"
},
"engines": {
"node": ">=0.8.x <0.11"
}
}

0 comments on commit 62b67c9

Please sign in to comment.