Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 131 lines (97 sloc) 4.165 kb
98a5bb9 @tj Initial commit
tj authored
1
2 # component
3
d06fab4 @tj docs
tj authored
4 Component package manager.
5
6 ## Installation
7
37b0511 @tj docs
tj authored
8 $ npm install -g component
d06fab4 @tj docs
tj authored
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
54
32f16ca @tj docs
tj authored
55 ## Features
56
57 - no registry required, uses github repositories
6b2b654 @tj docs
tj authored
58 - pretty fast (~2x faster than uncached npm at the time of comparison)
b33beb6 @tj docs
tj authored
59 - extensible sub-commands via `component-YOURCOMMAND` git-style
6b2b654 @tj docs
tj authored
60 - component skeleton creation command
32f16ca @tj docs
tj authored
61 - resolves dependencies
62
0724267 @tj docs
tj authored
63 ## Dependencies
64
65 By using GitHub as the registry, `component(1)` is automatically
66 available to you without further explicit knowledge or work
67 creating a registry account etc.
68
69 A nice side-effect of this namespaced world is that dependencies
70 are explicit and self-documenting. No longer do you need to query
71 the registry for a "repo" property that may not exist, it's simply
72 build in to the package name, for example ["visionmedia/page.js"](https://github.com/visionmedia/page.js) rather
73 than the ambiguous "page".
74
7c0b0a2 @tj docs
tj authored
75 ## Creating a component
76
77 The `component-create(1)` command can create a component
78 project skeleton for you by filling out the prompts. Once
79 this repo is published to Github, you're all done!
80
81 ```
82 $ component create popover
83 repo (username/project): visionmedia/popover
84 description: Popover UI component
85 does this component have js? yes
86 does this component have css? yes
87 does this component have html? yes
88
89 create : popover
90 create : popover/index.js
91 create : popover/popover.html
92 create : popover/popover.css
93 create : popover/Readme.md
94 create : popover/component.json
95
96 ```
97
460e6fe @tj add some dev docs
tj authored
98 ## Developing component(1)
99
100 `component(1)` and sub-commands are structured much like `git(1)`,
101 in that sub-commands are simply separate executables. For example
102 `$ component info pkg` and `$ component-info pkg` are equivalent.
103
104 Because of this you'll likely want `PATH="./bin:$PATH"` in your
105 profile or session while developing component, otherwise `./bin/component`
106 will have a hard time finding the sub-commands.
107
98a5bb9 @tj Initial commit
tj authored
108 ## License
109
110 (The MIT License)
111
112 Copyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
113
114 Permission is hereby granted, free of charge, to any person obtaining
115 a copy of this software and associated documentation files (the
116 'Software'), to deal in the Software without restriction, including
117 without limitation the rights to use, copy, modify, merge, publish,
118 distribute, sublicense, and/or sell copies of the Software, and to
119 permit persons to whom the Software is furnished to do so, subject to
120 the following conditions:
121
122 The above copyright notice and this permission notice shall be
123 included in all copies or substantial portions of the Software.
124
125 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
126 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
127 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
128 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
129 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
130 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
131 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.