Skip to content
Newer
Older
100644 132 lines (98 sloc) 4.1 KB
98a5bb9 @tj Initial commit
tj authored Aug 1, 2012
1
2 # component
3
d06fab4 @tj docs
tj authored Aug 3, 2012
4 Component package manager.
5
6 ## Installation
7
8 $ npm install -g component
9
10 ## Installing packages
11
12 To install one or more packages, simply pass their github
13 repo names as arguments to `component install`. Dependencies
14 are resolved and the component contents are downloaded into
15 `./components` by default.
16
17 ```
18 $ component install component/tip
19
20 install : component/tip@master
21 dep : component/emitter@master
22 install : component/emitter@master
23 dep : component/jquery@master
24 install : component/jquery@master
25 fetch : component/tip:index.js
26 fetch : component/tip:tip.css
27 fetch : component/tip:tip.html
28 fetch : component/emitter:index.js
29 fetch : component/jquery:index.js
30 complete : component/emitter
31 complete : component/jquery
32 complete : component/tip
33 ```
34
35 ## Usage
36
37 Via `--help`:
38
39 ```
40 Usage: component <command> [options]
41
42 Options:
43
44 -h, --help output usage information
45 -V, --version output the version number
46
47 Commands:
48
49 install <name ...> install one or more components
50 search [query] search with the given query
51 info [prop] output json component information
52 ls list installed components
53 ```
98a5bb9 @tj Initial commit
tj authored Aug 2, 2012
54
32f16ca @tj docs
tj authored Aug 3, 2012
55 ## Features
56
57 - no registry required, uses github repositories
58 - fast (~2x faster than uncached npm at the time of comparison)
b33beb6 @tj docs
tj authored Aug 3, 2012
59 - extensible sub-commands via `component-YOURCOMMAND` git-style
32f16ca @tj docs
tj authored Aug 3, 2012
60 - hackable internals (no monolithic lib here)
61 - resolves dependencies
7c0b0a2 @tj docs
tj authored Aug 3, 2012
62 - component skeleton command
32f16ca @tj docs
tj authored Aug 3, 2012
63
0724267 @tj docs
tj authored Aug 3, 2012
64 ## Dependencies
65
66 By using GitHub as the registry, `component(1)` is automatically
67 available to you without further explicit knowledge or work
68 creating a registry account etc.
69
70 A nice side-effect of this namespaced world is that dependencies
71 are explicit and self-documenting. No longer do you need to query
72 the registry for a "repo" property that may not exist, it's simply
73 build in to the package name, for example ["visionmedia/page.js"](https://github.com/visionmedia/page.js) rather
74 than the ambiguous "page".
75
7c0b0a2 @tj docs
tj authored Aug 3, 2012
76 ## Creating a component
77
78 The `component-create(1)` command can create a component
79 project skeleton for you by filling out the prompts. Once
80 this repo is published to Github, you're all done!
81
82 ```
83 $ component create popover
84 repo (username/project): visionmedia/popover
85 description: Popover UI component
86 does this component have js? yes
87 does this component have css? yes
88 does this component have html? yes
89
90 create : popover
91 create : popover/index.js
92 create : popover/popover.html
93 create : popover/popover.css
94 create : popover/Readme.md
95 create : popover/component.json
96
97 ```
98
460e6fe @tj add some dev docs
tj authored Aug 3, 2012
99 ## Developing component(1)
100
101 `component(1)` and sub-commands are structured much like `git(1)`,
102 in that sub-commands are simply separate executables. For example
103 `$ component info pkg` and `$ component-info pkg` are equivalent.
104
105 Because of this you'll likely want `PATH="./bin:$PATH"` in your
106 profile or session while developing component, otherwise `./bin/component`
107 will have a hard time finding the sub-commands.
108
98a5bb9 @tj Initial commit
tj authored Aug 2, 2012
109 ## License
110
111 (The MIT License)
112
113 Copyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
114
115 Permission is hereby granted, free of charge, to any person obtaining
116 a copy of this software and associated documentation files (the
117 'Software'), to deal in the Software without restriction, including
118 without limitation the rights to use, copy, modify, merge, publish,
119 distribute, sublicense, and/or sell copies of the Software, and to
120 permit persons to whom the Software is furnished to do so, subject to
121 the following conditions:
122
123 The above copyright notice and this permission notice shall be
124 included in all copies or substantial portions of the Software.
125
126 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
127 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
128 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
129 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
130 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
131 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
132 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.