diff options
author | isaacs <i@izs.me> | 2011-09-04 13:06:28 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-09-04 13:06:28 +0400 |
commit | 0447122b862839e624fa784f09adfc48b536b7d0 (patch) | |
tree | f7564d658e4ae79e883d514ea6f079e4fc22e6a5 /html | |
parent | 3edcd7183b9a1d5b5fb2739764eb2159c5df19e1 (diff) |
README.html doc
Diffstat (limited to 'html')
-rw-r--r-- | html/doc/README.html | 558 |
1 files changed, 558 insertions, 0 deletions
diff --git a/html/doc/README.html b/html/doc/README.html new file mode 100644 index 000000000..8b9dc059d --- /dev/null +++ b/html/doc/README.html @@ -0,0 +1,558 @@ +<!doctype html> +<html> + <title></title> + <meta http-equiv="content-type" value="text/html;utf-8"> +<style type="text/css"> + +/* reset */ +* { + margin:0; + padding:0; + border:none; + font-family:inherit; + font-size:inherit; + font-weight:inherit; +} +:target::before { + content:" >>> "; + position:absolute; + display:block; + opacity:0.5; + color:#f00; + margin:0 0 0 -2em; +} +abbr, acronym { + border-bottom:1px dotted #aaa; +} +kbd, code, pre { + font-family:monospace; + margin:0; + font-size:18px; + line-height:24px; + background:#eee; + outline:1px solid #ccc; +} +kbd code, kbd pre, kbd kbd, +pre code, pre pre, pre kbd, +code code, code pre, code kbd { outline: none } +.dollar::before { + content:"$ "; + display:inline; +} +p, ul, ol, dl, pre { + margin:30px 0; + line-height:30px; +} +hr { + margin:30px auto 29px; + width:66%; + height:1px; + background:#aaa; +} +pre { + display:block; +} +dd :first-child { + margin-top:0; +} + +body { + quotes:"“" "”" "‘" "’"; + width:666px; + margin:30px auto 120px; + font-family:Times New Roman, serif; + font-size:20px; + background:#fff; + line-height:30px; + color:#111; +} + +blockquote { + position:relative; + font-size:16px; + line-height:30px; + font-weight:bold; + width:85%; + margin:0 auto; +} +blockquote::before { + font-size:90px; + display:block; + position:absolute; + top:20px; + right:100%; + content:"“"; + padding-right:10px; + color:#ccc; +} +.source cite::before { + content:"— "; +} +.source { + padding-left:20%; + margin-top:30px; +} +.source cite span { + font-style:normal; +} +blockquote p { + margin-bottom:0; +} +.quote blockquote { + font-weight:normal; +} + +h1, h2, h3, h4, h5, h6, dt, #header { + font-family:serif; + font-size:20px; + font-weight:bold; +} +h2 { + background:#eee; +} +h1, h2 { + line-height:40px; +} + +i, em, cite { + font-style:italic; +} +b, strong { + font-weight:bold; +} +i, em, cite, b, strong, small { + line-height:28px; +} +small, .small, .small *, aside { + font-style:italic; + color:#669; + font-size:18px; +} +spall a, .small a { + text-decoration:underline; +} +del { + text-decoration:line-through; +} +ins { + text-decoration:underline; +} +.alignright { display:block; float:right; margin-left:1em; } +.alignleft { display:block; float:left; margin-right:1em; } + +q:before, q q q:before, q q q q q:before, q q q q q q q:before { content:"“"; } +q q:before, q q q q:before, q q q q q q:before, q q q q q q q q:before { content:"‘"; } +q:after, q q q:after, q q q q q:after, q q q q q q q:after { content:"”"; } +q q:after, q q q q:after, q q q q q q:after, q q q q q q q q:after { content:"’"; } + +a { color:#00f; text-decoration:none; } +a:visited { color:#636; } +a:hover, a:active { color:#900!important; text-decoration:underline; } + +h1 { + font-weight:bold; + background:#fff; +} +h1 a, h1 a:visited { + font-family:GubbleBum, gubblefont, monospace; + font-size:60px; + color:#900; + display:block; +} + +.navigation { + display:table; + width:100%; + margin:0 0 30px 0; + position:relative; +} +#nav-above { + margin-bottom:0; +} +.navigation .nav-previous { + display:table-cell; + text-align:left; + width:50%; +} +/* hang the » and « off into the margins */ +.navigation .nav-previous a:before, .navigation .nav-next a:after { + content: "«"; + display:block; + height:30px; + margin-bottom:-30px; + text-decoration:none; + margin-left:-15px; +} +.navigation .nav-next a:after { + content: "»"; + text-align:right; + margin-left:0; + margin-top:-30px; + margin-right:-15px; +} + + +.navigation .nav-next { + display:table-cell; + text-align:right; + width:50%; +} +.navigation a { + display:block; + width:100%; + height:100%; +} + +input, button, textarea { + border:0; + line-height:30px; +} +textarea { + height:300px; +} +input { + height:30px; + line-height:30px; +} +input.submit, input#submit, input.button, button, input[type=submit] { + cursor:hand; cursor:pointer; + outline:1px solid #ccc; +} + +#wrapper { + margin-bottom:90px; + position:relative; + z-index:1; + *zoom:1; + background:#fff; +} +#wrapper:after { + display:block; + content:"."; + visibility:hidden; + width:0; + height:0; + clear:both; +} + +.sidebar .xoxo > li { + float:left; + width:50%; +} +.sidebar li { + list-style:none; +} +.sidebar #elsewhere { + margin-left:-10%; + margin-right:-10%; +} +.sidebar #rss-links, .sidebar #twitter-feeds { + float:right; + clear:right; + width:20%; +} +.sidebar #comment { + clear:both; + float:none; + width:100%; +} +.sidebar #search { + clear:both; + float:none; + width:100%; +} +.sidebar #search h2 { + margin-left:40%; +} +.sidebar #search #s { + width:90%; + float:left; +} +.sidebar #search #searchsubmit { + width:10%; + float:right; +} +.sidebar * { + font-size:15px; + line-height:30px; +} + +#footer, #footer * { + margin:300px 0 0; + text-align:right; + font-size:14px; + line-height:90px; +} + +#toc { + position:absolute; + top:0; + right:0; + padding:40px 0 40px 20px; + margin:0; + width:200px; + opacity:0.2; + z-index:-1; +} +#toc:hover { + opacity:1; + background:#fff; + z-index:999; +} +#toc ul { + padding:0; + margin:0; +} +#toc, #toc li { + list-style-type:none; + font-size:15px; + line-height:15px; +} +#toc li { + padding:0 0 0 10px; +} +#toc li a { + position:relative; + display:block; +} + +@font-face { + font-family:gubblefont; + src: url(http://static.izs.me/fonts/GubbleBum-Blocky.ttf) format("truetype"); +} + +@media print { + a[href] { + color:inherit; + } + a[href]:after { + white-space:nowrap; + content:" " attr(href); + } + a[href^=\#], .navigation { + display:none; + } +} +</style> + + <body> + <div id="wrapper"> +<h1><a href="npm.html">npm</a></h1> <p>node package manager</p> + +<p>This is just enough info to get you up and running.</p> + +<p>Much more info available via <code>npm help</code> once it's installed.</p> + +<h2 id="IMPORTANT">IMPORTANT</h2> + +<p><strong>You need node v0.4 or higher to run this program.</strong></p> + +<p>To install an old <strong>and unsupported</strong> version of npm that works on node 0.3 +and prior, clone the git repo and dig through the old tags and branches.</p> + +<h2 id="Simple-Install">Simple Install</h2> + +<p>To install npm with one command, do this:</p> + +<pre><code>curl http://npmjs.org/install.sh | sh</code></pre> + +<p>To skip the npm 0.x cleanup, do this:</p> + +<pre><code>curl http://npmjs.org/install.sh | clean=no sh</code></pre> + +<p>To say "yes" to the 0.x cleanup, but skip the prompt:</p> + +<pre><code>curl http://npmjs.org/install.sh | clean=yes sh</code></pre> + +<p>If that fails, try this:</p> + +<pre><code>git clone https://github.com/isaacs/npm.git +cd npm +sudo make install</code></pre> + +<p>If you're sitting in the code folder reading this document in your +terminal, then you've already got the code. Just do:</p> + +<pre><code>sudo make install</code></pre> + +<p>and npm will install itself.</p> + +<p>If you don't have make, and don't have curl or git, and ALL you have is +this code and node, you can probably do this:</p> + +<pre><code>sudo node ./cli.js install -g</code></pre> + +<p>However, note that github tarballs <strong>do not contain submodules</strong>, so +those won't work. You'll have to also fetch the appropriate submodules +listed in the .gitmodules file.</p> + +<h2 id="Permissions">Permissions</h2> + +<p><strong>tl;dr</strong></p> + +<ul><li>Use <code>sudo</code> for greater safety. Or don't, if you prefer not to.</li><li>npm will downgrade permissions if it's root before running any build +scripts that package authors specified.</li></ul> + +<h3 id="More-details">More details...</h3> + +<p>As of version 0.3, it is recommended to run npm as root. +This allows npm to change the user identifier to the <code>nobody</code> user prior +to running any package build or test commands.</p> + +<p>If you are not the root user, or if you are on a platform that does not +support uid switching, then npm will not attempt to change the userid.</p> + +<p>If you would like to ensure that npm <strong>always</strong> runs scripts as the +"nobody" user, and have it fail if it cannot downgrade permissions, then +set the following configuration param:</p> + +<pre><code>npm config set unsafe-perm false</code></pre> + +<p>This will prevent running in unsafe mode, even as non-root users.</p> + +<h2 id="Uninstalling">Uninstalling</h2> + +<p>So sad to see you go.</p> + +<pre><code>sudo npm uninstall npm -g</code></pre> + +<p>Or, if that fails,</p> + +<pre><code>sudo make uninstall</code></pre> + +<h2 id="More-Severe-Uninstalling">More Severe Uninstalling</h2> + +<p>Usually, the above instructions are sufficient. That will remove +npm, but leave behind anything you've installed.</p> + +<p>If you would like to remove all the packages that you have installed, +then you can use the <code>npm ls</code> command to find them, and then <code>npm rm</code> to +remove them.</p> + +<p>To remove cruft left behind by npm 0.x, you can use the included +<code>clean-old.sh</code> script file. You can run it conveniently like this:</p> + +<pre><code>npm explore npm -g -- sh scripts/clean-old.sh</code></pre> + +<p>npm uses two configuration files, one for per-user configs, and another +for global (every-user) configs. You can view them by doing:</p> + +<pre><code>npm config get userconfig # defaults to ~/.npmrc +npm config get globalconfig # defaults to /usr/local/etc/npmrc</code></pre> + +<p>Uninstalling npm does not remove configuration files by default. You +must remove them yourself manually if you want them gone. Note that +this means that future npm installs will not remember the settings that +you have chosen.</p> + +<h2 id="Using-npm-Programmatically">Using npm Programmatically</h2> + +<p>If you would like to use npm programmatically, you can do that. +It's not very well documented, but it <em>is</em> rather simple.</p> + +<pre><code>var npm = require("npm") +npm.load(myConfigObject, function (er) { + if (er) return handlError(er) + npm.commands.install(["some", "args"], function (er, data) { + if (er) return commandFailed(er) + // command succeeded, and data might have some info + }) + npm.on("log", function (message) { .... }) +})</code></pre> + +<p>The <code>load</code> function takes an object hash of the command-line configs. +The various <code>npm.commands.<cmd></code> functions take an <strong>array</strong> of +positional argument <strong>strings</strong>. The last argument to any +<code>npm.commands.<cmd></code> function is a callback. Some commands take other +optional arguments. Read the source.</p> + +<p>You cannot set configs individually for any single npm function at this +time. Since <code>npm</code> is a singleton, any call to <code>npm.config.set</code> will +change the value for <em>all</em> npm commands in that process.</p> + +<p>See <code>./bin/npm.js</code> for an example of pulling config values off of the +command line arguments using nopt. You may also want to check out <code>npm +help config</code> to learn about all the options you can set there.</p> + +<h2 id="More-Docs">More Docs</h2> + +<p>Check out the <a href="http://npmjs.org/doc/">docs</a>, +especially the +<a href="http://npmjs.org/doc/faq.html">faq</a>.</p> + +<p>You can use the <code>npm help</code> command to read any of them.</p> + +<p>If you're a developer, and you want to use npm to publish your program, +you should +<a href="http://npmjs.org/doc/developers.html">read this</a></p> + +<h2 id="Legal-Stuff">Legal Stuff</h2> + +<p>"npm" and "the npm registry" are owned by Isaac Z. Schlueter. All +rights not explicitly granted in the MIT license are reserved. See the +included LICENSE file for more details.</p> + +<p>"Node.js" and "node" are trademarks owned by Joyent, Inc. npm is not +officially part of the Node.js project, and is neither owned by nor +officially affiliated with Joyent, Inc.</p> + +<p>The packages in the npm registry are not part of npm itself, and are the +sole property of their respective maintainers. While every effort is +made to ensure accountability, there is absolutely no guarantee, +warrantee, or assertion made as to the quality, fitness for a specific +purpose, or lack of malice in any given npm package. Modules +published on the npm registry are not affiliated with or endorsed by +Joyent, Inc., Isaac Z. Schlueter, Ryan Dahl, or the Node.js project.</p> + +<p>If you have a complaint about a package in the npm registry, and cannot +resolve it with the package owner, please express your concerns to +Isaac Z. Schlueter at <a href="mailto:i@izs.me">i@izs.me</a>.</p> + +<h3 id="In-plain-english">In plain english</h3> + +<p>This is mine; not my employer's, not Node's, not Joyent's, not Ryan +Dahl's.</p> + +<p>If you publish something, it's yours, and you are solely accountable +for it. Not me, not Node, not Joyent, not Ryan Dahl.</p> + +<p>If other people publish something, it's theirs. Not mine, not Node's, +not Joyent's, not Ryan Dahl's.</p> + +<p>Yes, you can publish something evil. It will be removed promptly if +reported, and we'll lose respect for you. But there is no vetting +process for published modules.</p> + +<p>If this concerns you, inspect the source before using packages.</p> +</div> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper) + .getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + el.innerHTML + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> +</body></html> |