aboutsummaryrefslogtreecommitdiff
path: root/node_modules/node-cmd/example/basic.js
blob: 66fcc54e07531b9a8feed54f063c241c5c0c1442 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var cmd=require('../cmd.js');

cmd.get(
    'pwd',
    function(data){
        console.log('the current working dir is : ',data)
    }
);

cmd.run('touch example.created.file');

cmd.get(
    'ls',
    function(data){
        console.log('the current dir contains these files :\n\n',data)
    }
);

cmd.get(
    `
        git clone https://github.com/RIAEvangelist/node-cmd.git
        cd node-cmd
        ls
    `,
    function(data){
        console.log('the node-cmd clone dir contains these files :\n\n',data)
    }
);