Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcollina/taskplanner
Plan any task into subtasks!
https://github.com/mcollina/taskplanner
Last synced: 13 days ago
JSON representation
Plan any task into subtasks!
- Host: GitHub
- URL: https://github.com/mcollina/taskplanner
- Owner: mcollina
- License: mit
- Created: 2014-05-26T15:09:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-06T12:40:51.000Z (over 10 years ago)
- Last Synced: 2024-12-25T10:21:26.665Z (15 days ago)
- Language: JavaScript
- Size: 172 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
taskplanner
===========Plan any task into subtasks!
```js
var planner = require('taskplanner')()
, assert = require('assert')
, expected = [{
cmd: 'get car'
}, {
cmd: 'drive'
, to: 'supermarket'
}]
, planplan = planner.addTask({ cmd: 'go', to: 'supermarket' }, {
preconditions: { state: 'in the car' }
, subTasks: [ { cmd: 'drive', to: 'supermarket' } ]
}).addTask({ cmd: 'go', to: 'supermarket' }, {
preconditions: { state: 'at home' }
, subTasks: [ { cmd: 'get car' }, { cmd: 'go', to: 'supermarket' } ]
}).addTask({ cmd: 'get car' }, {
preconditions: { state: 'at home' }
, effects: { state: 'in the car' }
}).addTask({ cmd: 'drive', to: 'supermarket' }, {
preconditions: { state: 'in the car' }
, effects: { state: 'in the supermarket' }
}).plan({ state: 'at home' }, { cmd: 'go', to: 'supermarket' })assert.deepEqual(plan, expected)
```Acknowledgements
----------------This project was kindly sponsored by [nearForm](http://nearform.com).
License
-------MIT