Skip to content

Commit

Permalink
Merge pull request #20 from stephen-last/node-style-error-first-callback
Browse files Browse the repository at this point in the history
Error-first style callback
  • Loading branch information
RIAEvangelist committed Apr 16, 2017
2 parents cf36c65 + a271777 commit 520cbcf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#node-cmd
# node-cmd
-
*Node.js commandline/terminal interface.*

Expand All @@ -25,7 +25,7 @@ Package details websites :
This work is licenced via the [DBAD Public Licence](http://www.dbad-license.org/).


#Methods
# Methods
-

|method | arguments | functionality |
Expand All @@ -34,7 +34,7 @@ This work is licenced via the [DBAD Public Licence](http://www.dbad-license.org/
|get | command,callback | runs a command asynchronously, when the command is complete all of the stdout will be passed to the callback|


#Examples
# Examples
-

```javascript
Expand All @@ -43,7 +43,7 @@ This work is licenced via the [DBAD Public Licence](http://www.dbad-license.org/

cmd.get(
'pwd',
function(data){
function(err, data, stderr){
console.log('the current working dir is : ',data)
}
);
Expand All @@ -52,7 +52,7 @@ This work is licenced via the [DBAD Public Licence](http://www.dbad-license.org/

cmd.get(
'ls',
function(data){
function(err, data, stderr){
console.log('the current dir contains these files :\n\n',data)
}
);
Expand All @@ -63,7 +63,7 @@ This work is licenced via the [DBAD Public Licence](http://www.dbad-license.org/
cd node-cmd
ls
`,
function(data, err, stderr){
function(err, data, stderr){
if (!err) {
console.log('the node-cmd cloned dir contains these files :\n\n',data)
} else {
Expand Down
2 changes: 1 addition & 1 deletion cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getString(command,callback){
if(!callback)
return;

callback(data, err, stderr);
callback(err, data, stderr);
}
}
)(callback)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-cmd",
"version": "2.0.0",
"version": "3.0.0",
"description": "Simple commandline/terminal interface to allow you to run cli or bash style commands as if you were in the terminal.",
"main": "cmd.js",
"directories": {
Expand Down

0 comments on commit 520cbcf

Please sign in to comment.