Skip to content

Commit 520cbcf

Browse files
Merge pull request #20 from stephen-last/node-style-error-first-callback
Error-first style callback
2 parents cf36c65 + a271777 commit 520cbcf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#node-cmd
1+
# node-cmd
22
-
33
*Node.js commandline/terminal interface.*
44

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

2727

28-
#Methods
28+
# Methods
2929
-
3030

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

3636

37-
#Examples
37+
# Examples
3838
-
3939

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

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

5353
cmd.get(
5454
'ls',
55-
function(data){
55+
function(err, data, stderr){
5656
console.log('the current dir contains these files :\n\n',data)
5757
}
5858
);
@@ -63,7 +63,7 @@ This work is licenced via the [DBAD Public Licence](http://www.dbad-license.org/
6363
cd node-cmd
6464
ls
6565
`,
66-
function(data, err, stderr){
66+
function(err, data, stderr){
6767
if (!err) {
6868
console.log('the node-cmd cloned dir contains these files :\n\n',data)
6969
} else {

cmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function getString(command,callback){
2222
if(!callback)
2323
return;
2424

25-
callback(data, err, stderr);
25+
callback(err, data, stderr);
2626
}
2727
}
2828
)(callback)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-cmd",
3-
"version": "2.0.0",
3+
"version": "3.0.0",
44
"description": "Simple commandline/terminal interface to allow you to run cli or bash style commands as if you were in the terminal.",
55
"main": "cmd.js",
66
"directories": {

0 commit comments

Comments
 (0)