1.0.0 • Published 9 years ago

celeri v1.0.0

Weekly downloads
139
License
ISC
Repository
github
Last release
9 years ago

C-e-L-er-I is an es6 command line utility belt library for NodeJS.

Example

{ prompt, confirm } = require("celeri");

var name = yield prompt("What is your name?"); 

console.log(name);

if (yield confirm("Do you like dog spaghetti?")) {
    console.log("awesome!");
}

Utilities

Promise celeri.prompt(label)

Prompts the user for a question

import { prompt } from "celeri";
console.log("Your name is %s", yield prompt("What is your name?"));

Promise celeri.confirm(label, default)

Confirm y/n

import { confirm } from "celeri";
if (yield confirm("Do you like cheese?", true)) {
    console.log("you like cheese.");
} else {
    console.log("you do not like cheese.");
}

Promise celeri.pickOne(label, items)

Picks one item from a list

import { pickOne, listItem } from "celeri";

var color = yield pickOne("What is your favorite color?", ["red", "green", "blue"]);

console.log("your favorite color is %s", color);

Promise celeri.pickMany(label, items)

Picks many items from a list

var colors = yield pickMany("what are your favorite colors?", ["red", "green", "blue"]);

Promise celeri.secret(label)

Prompts the user for a secret value (hidden from stdout).

var password = yield secret("What's the secret?");

ListItem celeri.listItem(optionsOrValue)

Creates a new list item

  • optionsOrValue - options or value of list item
    • label
var glob = require("glob");
var file = yield pickOne("Pick a file", glob.sync(process.cwd() + "/*").map(function(filename) {
    return listItem({
        label: filename,
        value: filename
    })
}))
1.0.0

9 years ago

0.3.4

10 years ago

0.3.3

11 years ago

0.3.2

12 years ago

0.3.1

12 years ago

0.3.0

12 years ago

0.2.16

12 years ago

0.2.15

12 years ago

0.2.14

13 years ago

0.2.13

13 years ago

0.2.12

13 years ago

0.2.11

13 years ago

0.2.10

13 years ago

0.2.9

13 years ago

0.2.8

13 years ago

0.2.7

13 years ago

0.2.6

13 years ago

0.2.5

13 years ago

0.2.4

13 years ago

0.2.3

13 years ago

0.2.2

13 years ago

0.2.1

13 years ago

0.2.0

13 years ago

0.1.3

13 years ago

0.1.2

13 years ago

0.1.1

13 years ago

0.1.0

13 years ago

0.0.10

13 years ago

0.0.9

13 years ago

0.0.8

13 years ago

0.0.7

13 years ago

0.0.6

13 years ago

0.0.5

13 years ago

0.0.3

13 years ago