https://github.com/featurist/qo
finally, a task runner for insect people
https://github.com/featurist/qo
Last synced: about 2 months ago
JSON representation
finally, a task runner for insect people
- Host: GitHub
- URL: https://github.com/featurist/qo
- Owner: featurist
- Created: 2013-10-14T09:08:40.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-08-04T09:00:17.000Z (over 8 years ago)
- Last Synced: 2025-02-20T09:17:13.580Z (2 months ago)
- Language: PogoScript
- Size: 31.3 KB
- Stars: 3
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# qo [](https://www.npmjs.com/package/qo) [](https://www.npmjs.com/package/qo) [](https://travis-ci.org/featurist/qo)
A task runner for insect people.
## install
npm install qo
## how to use
Write a file `qo.js`:
```js
task('hi', function () {
console.log('hi!');
});
```Then
```bash
# qo hi
hi!
```### named arguments
```js
task('hi', function (args, options) {
console.log("hi " + options.name);
});
```Then
```bash
# qo hi --name jack
hi jack
```### lists of arguments
```js
task('hi', function (args) {
console.log("hi " + args.join(', '));
});
```Then
```bash
# qo hi jack jill jesse
hi jack, jill, jesse
```### promises
If you return a promise, and it's rejected, then `qo` will print the error exit with `1`.
```js
var fs = require('fs-promise');task('print', function (args) {
return fs.readFile(args[0], 'utf-8').then(function (contents) {
console.log(contents);
});
});
```Then
```bash
# qo print some-file.txt
Error: ENOENT, open 'some-file.txt'
at Error (native)
```### task descriptions
```js
task('hi', {desc: 'says hi'}, function () {
console.log('hi');
});
```Then
```bash
# qo
tasks:hi, says hi
```You can also put descriptive arguments into the task name:
```js
task('hi ', {desc: 'says hi to '}, function (args) {
console.log('hi ' + args[0]);
});
```Then
```bash
# qo
tasks:hi , says hi to
```# pogoscript
you can write a `qo.pogo` file too. Pogoscript happens to be very useful for writing heavily asynchronous code, and great for little scripts that get things done.