UNPKG

4.66 kBMarkdownView Raw
1![Idea](http://i.imgur.com/BGMt0Ne.png)
2
3# idea
4A lightweight CLI tool and module for keeping your ideas in a safe place quick and easy.
5
6## Installation
7
8```sh
9$ npm install -g idea
10```
11
12## Usage
13
14```sh
15$ idea help
16idea help
17usage: idea [command] <idea|filter|id>
18
19A lightweight CLI tool and module for keeping your ideas in a safe place quick and easy.
20
21[command]
22 create <idea> Creates and saves a new idea. Example: `idea create "Implement something very cool"`
23 list Lists all ideas. Example: `idea list`
24 filter <filter> Lists filtered ideas. Example: `idea filter '{"state": "SOLVED"}'`
25 solve <id> Solves an idea. Example `idea solve 1`
26 help Prints this help.
27
28Documentation can be found at https://github.com/IonicaBizau/idea
29$ idea create 'Implement the idea tool.'
30$ idea
31┌──┬────────────────────────┬────────────────────────┬────────────────────────┐
32│Id│Date │State │Idea │
33├──┼────────────────────────┼────────────────────────┼────────────────────────┤
34│1 │2015-01-15T14:09:06.233Z│OPEN │Implement the idea tool.│
35└──┴────────────────────────┴────────────────────────┴────────────────────────┘
36$ idea solve 1
37$ idea
38info No ideas fetched.
39$ idea list
40┌──┬────────────────────────┬────────────────────────┬────────────────────────┐
41│Id│Date │State │Idea │
42├──┼────────────────────────┼────────────────────────┼────────────────────────┤
43│1 │2015-01-15T14:09:06.233Z│SOLVED │Implement the idea tool.│
44└──┴────────────────────────┴────────────────────────┴────────────────────────┘
45```
46
47## API
48The `idea` can be used as library. See the below example and documentation.
49
50### Example
51
52```js
53// Dependencies
54var IdeaContainer = require("idea");
55
56// Initialize the idea object
57var idea = new IdeaContainer("./ideas.json", function (err) {
58 if (err) throw err;
59 idea.create("Implement something cool.", function (err) {
60 if (err) throw err;
61 });
62});
63```
64
65### `Idea(path, callback)`
66
67#### Params
68- **String** `path`: The path to the JSON file where your ideas will be stored (default: `~/.ideas.json`).
69- **Function** `callback`: The callback function.
70
71#### Return
72- **Idea** The `Idea` instance.
73
74### `list(callback)`
75Lists all ideas.
76
77#### Params
78- **Function** `callback`: The callback function.
79
80#### Return
81- **Idea** The `Idea` instance.
82
83### `filter(filters, callback)`
84Filters ideas.
85
86#### Params
87- **Object** `filters`: An MongoDB like query object.
88- **Function** `callback`: The callback function.
89
90#### Return
91- **Idea** The `Idea` instance.
92
93### `create(idea, callback)`
94
95#### Params
96- **String** `idea`: The idea you have.
97- **Function** `callback`: The callback function.
98
99#### Return
100- **Idea** The `Idea` instance.
101
102### `solve(id, callback)`
103Solves an idea.
104
105#### Params
106- **String** `id`: The idea id.
107- **Function** `callback`: The callback function.
108
109#### Return
110- **Idea** The `Idea` instance.
111
112### `save(callback)`
113Saves the ideas in the file.
114
115#### Params
116- **Function** `callback`: The callback function.
117
118#### Return
119- **Idea** The `Idea` instance.
120
121## How to contribute
1221. File an issue in the repository, using the bug tracker, describing the
123 contribution you'd like to make. This will help us to get you started on the
124 right foot.
1252. Fork the project in your account and create a new branch:
126 `your-great-feature`.
1273. Commit your changes in that branch.
1284. Open a pull request, and reference the initial issue in the pull request
129 message.
130
131## License
132See the [LICENSE](./LICENSE) file.