node-machine
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -22,2 +22,3 @@ /** | ||
' [Machine: %s]\n'+ | ||
' %s\n'+ | ||
' \n'+ | ||
@@ -50,5 +51,6 @@ ' Inputs:'+ | ||
'-----------------------------------------\n', | ||
machineDef.id | ||
machineDef.id, | ||
machineDef.description | ||
); | ||
}; | ||
}; |
@@ -57,3 +57,10 @@ /** | ||
machineInstance.configure.apply(machineInstance, Array.prototype.slice.call(arguments)); | ||
return machineInstance.exec(); | ||
// If multiple arguments were provided, go ahead and exec() the machine instance | ||
if (arguments.length > 1) { | ||
return machineInstance.exec(); | ||
} | ||
// Otherwise just return it | ||
return machineInstance; | ||
}; | ||
@@ -60,0 +67,0 @@ _callableMachineWrapper.exec = function (){ |
{ | ||
"name": "node-machine", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Configure and execute a machine using inputs and exits", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# node-machine | ||
First, here's a quick example: | ||
```bash | ||
$ node | ||
> require('machinepack-github').getRepo | ||
----------------------------------------- | ||
[Machine: get-repo] | ||
Fetch metadata about a github repo. | ||
Inputs: | ||
• repo (type: string) | ||
• user (type: string) | ||
----------------------------------------- | ||
> require('machinepack-github').getRepo({repo: 'sails', user: 'balderdashy'}).exec(console.log) | ||
{ ... } | ||
``` | ||
## Using a machine | ||
@@ -93,2 +113,7 @@ | ||
```bash | ||
$ node | ||
``` | ||
```javascript | ||
@@ -98,2 +123,13 @@ var Machine = require('node-machine'); | ||
```bash | ||
----------------------------------------- | ||
node-machine | ||
v0.2.2 | ||
• License : MIT | ||
• Docs : http://node-machine.org | ||
----------------------------------------- | ||
``` | ||
As with the top-level value exported from any node module, you really shouldn't make changes to this object since it would pollute the module elsewhere in the currently-running process (in other functions, other files, and even other modules!) | ||
@@ -100,0 +136,0 @@ |
31118
738
203