Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 135 lines (100 sloc) 4.327 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 ```
2811ddd @tj update docs
tj authored
82 name: popover
83 description: Popover UI component
7c0b0a2 @tj docs
tj authored
84 does this component have js? yes
85 does this component have css? yes
86 does this component have html? yes
87
2811ddd @tj update docs
tj authored
88 create : popover
89 create : popover/index.js
90 create : popover/template.html
91 create : popover/popover.css
92 create : popover/Makefile
93 create : popover/Readme.md
94 create : popover/.gitignore
95 create : popover/component.json
7c0b0a2 @tj docs
tj authored
96
97 ```
98
67002d6 @tj docs
tj authored
99 A `Makefile` is created for you in order to create a build of the component,
100 complete with installed dependencies simply execute `make`.
101
460e6fe @tj add some dev docs
tj authored
102 ## Developing component(1)
103
104 `component(1)` and sub-commands are structured much like `git(1)`,
105 in that sub-commands are simply separate executables. For example
106 `$ component info pkg` and `$ component-info pkg` are equivalent.
107
108 Because of this you'll likely want `PATH="./bin:$PATH"` in your
109 profile or session while developing component, otherwise `./bin/component`
110 will have a hard time finding the sub-commands.
111
98a5bb9 @tj Initial commit
tj authored
112 ## License
113
114 (The MIT License)
115
116 Copyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
117
118 Permission is hereby granted, free of charge, to any person obtaining
119 a copy of this software and associated documentation files (the
120 'Software'), to deal in the Software without restriction, including
121 without limitation the rights to use, copy, modify, merge, publish,
122 distribute, sublicense, and/or sell copies of the Software, and to
123 permit persons to whom the Software is furnished to do so, subject to
124 the following conditions:
125
126 The above copyright notice and this permission notice shall be
127 included in all copies or substantial portions of the Software.
128
129 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
130 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
131 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
132 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
133 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
134 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
135 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.