1 | ![Idea](http://i.imgur.com/BGMt0Ne.png)
|
2 |
|
3 | # idea
|
4 | A 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
|
16 | idea help
|
17 | usage: idea [command] <idea|filter|id>
|
18 |
|
19 | A 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 |
|
28 | Documentation 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
|
38 | info 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
|
48 | The `idea` can be used as library. See the below example and documentation.
|
49 |
|
50 | ### Example
|
51 |
|
52 | ```js
|
53 | // Dependencies
|
54 | var IdeaContainer = require("idea");
|
55 |
|
56 | // Initialize the idea object
|
57 | var 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)`
|
75 | Lists all ideas.
|
76 |
|
77 | #### Params
|
78 | - **Function** `callback`: The callback function.
|
79 |
|
80 | #### Return
|
81 | - **Idea** The `Idea` instance.
|
82 |
|
83 | ### `filter(filters, callback)`
|
84 | Filters 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)`
|
103 | Solves 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)`
|
113 | Saves 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
|
122 | 1. 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.
|
125 | 2. Fork the project in your account and create a new branch:
|
126 | `your-great-feature`.
|
127 | 3. Commit your changes in that branch.
|
128 | 4. Open a pull request, and reference the initial issue in the pull request
|
129 | message.
|
130 |
|
131 | ## License
|
132 | See the [LICENSE](./LICENSE) file.
|