Permalink
Browse files

Added a bunch of API docs. They aren't perfect, but they're a lot bet…

…ter than nothing
  • Loading branch information...
1 parent a98be6a commit 001b6d0c06b423e071eb714541c3c10f5894b37e @beatgammit beatgammit committed with isaacs Aug 20, 2011
Showing with 2,934 additions and 0 deletions.
  1. +1 −0 api-doc/author.md
  2. +15 −0 api-doc/bin.md
  3. +70 −0 api-doc/commands.md
  4. +26 −0 api-doc/config.md
  5. +20 −0 api-doc/deprecate.md
  6. +19 −0 api-doc/docs.md
  7. +24 −0 api-doc/edit.md
  8. +18 −0 api-doc/explore.md
  9. +1 −0 api-doc/find.md
  10. +1 −0 api-doc/get.md
  11. +30 −0 api-doc/help-search.md
  12. +1 −0 api-doc/home.md
  13. +29 −0 api-doc/init.md
  14. +19 −0 api-doc/install.md
  15. +33 −0 api-doc/link.md
  16. +1 −0 api-doc/list.md
  17. +1 −0 api-doc/ln.md
  18. +26 −0 api-doc/load.md
  19. +50 −0 api-doc/ls.md
  20. +84 −0 api-doc/npm.md
  21. +13 −0 api-doc/outdated.md
  22. +31 −0 api-doc/owner.md
  23. +19 −0 api-doc/pack.md
  24. +15 −0 api-doc/prefix.md
  25. +17 −0 api-doc/prune.md
  26. +30 −0 api-doc/publish.md
  27. +16 −0 api-doc/rebuild.md
  28. +22 −0 api-doc/restart.md
  29. +1 −0 api-doc/rm.md
  30. +15 −0 api-doc/root.md
  31. +27 −0 api-doc/run-script.md
  32. +35 −0 api-doc/search.md
  33. +1 −0 api-doc/set.md
  34. +13 −0 api-doc/start.md
  35. +13 −0 api-doc/stop.md
  36. +28 −0 api-doc/submodule.md
  37. +23 −0 api-doc/tag.md
  38. +16 −0 api-doc/test.md
  39. +16 −0 api-doc/uninstall.md
  40. +20 −0 api-doc/unpublish.md
  41. +11 −0 api-doc/update.md
  42. +18 −0 api-doc/version.md
  43. +82 −0 api-doc/view.md
  44. +15 −0 api-doc/whoami.md
  45. +52 −0 man3/author.3
  46. +24 −0 man3/bin.3
  47. +147 −0 man3/commands.3
  48. +45 −0 man3/config.3
  49. +33 −0 man3/deprecate.3
  50. +28 −0 man3/docs.3
  51. +35 −0 man3/edit.3
  52. +28 −0 man3/explore.3
  53. +79 −0 man3/find.3
  54. +45 −0 man3/get.3
  55. +51 −0 man3/help-search.3
  56. +28 −0 man3/home.3
  57. +39 −0 man3/init.3
  58. +29 −0 man3/install.3
  59. +53 −0 man3/link.3
  60. +79 −0 man3/list.3
  61. +53 −0 man3/ln.3
  62. +44 −0 man3/load.3
  63. +79 −0 man3/ls.3
  64. +107 −0 man3/npm.3
  65. +21 −0 man3/outdated.3
  66. +52 −0 man3/owner.3
  67. +28 −0 man3/pack.3
  68. +24 −0 man3/prefix.3
  69. +27 −0 man3/prune.3
  70. +51 −0 man3/publish.3
  71. +22 −0 man3/rebuild.3
  72. +37 −0 man3/restart.3
  73. +25 −0 man3/rm.3
  74. +24 −0 man3/root.3
  75. +48 −0 man3/run-script.3
  76. +64 −0 man3/search.3
  77. +45 −0 man3/set.3
  78. +21 −0 man3/start.3
  79. +21 −0 man3/stop.3
  80. +42 −0 man3/submodule.3
  81. +31 −0 man3/tag.3
  82. +25 −0 man3/test.3
  83. +25 −0 man3/uninstall.3
  84. +30 −0 man3/unpublish.3
  85. +18 −0 man3/update.3
  86. +27 −0 man3/version.3
  87. +158 −0 man3/view.3
  88. +24 −0 man3/whoami.3
View
View
@@ -0,0 +1,15 @@
+npm-bin(3) -- Display npm bin folder
+====================================
+
+## SYNOPSIS
+
+ npm.commands.bin(args, callback)
+
+## DESCRIPTION
+
+Print the folder where npm will install executables.
+
+'args' is never used and callback is never called with data.
+'args' must be present or things will break.
+
+This function is not useful programmatically.
View
@@ -0,0 +1,70 @@
+npm-commands(3) -- npm commands
+===============================
+
+## SYNOPSIS
+
+ npm.commands.<command>(args, callback)
+
+## DESCRIPTION
+
+npm comes with a full set of commands, and each of the commands takes a
+similar set of arguments.
+
+In general, all commands on the command object take an **array** of positional
+argument **strings**. The last argument to any function is a callback. Some
+commands are special and take other optional arguments.
+
+All commands have their own man page. See `man npm-<command>` for command-line
+usage, or `man 3 npm-<command>` for programmatic usage.
+
+## COMMANDS
+
+### install
+
+Install a package.
+
+* "install"
+* "uninstall"
+ "cache"
+* "config"
+* "set"
+* "get"
+* "update"
+* "outdated"
+* "prune"
+* "submodule"
+* "pack"
+
+* "rebuild"
+* "link"
+
+* "publish"
+* "tag"
+ "adduser"
+* "unpublish"
+* "owner"
+* "deprecate"
+
+ "help"
+* "help-search"
+* "ls"
+* "search"
+* "view"
+* "init"
+* "version"
+* "edit"
+* "explore"
+* "docs"
+ "faq"
+* "root"
+* "prefix"
+* "bin"
+* "whoami"
+
+* "test"
+* "stop"
+* "start"
+* "restart"
+* "run-script"
+ "completion"
+
View
@@ -0,0 +1,26 @@
+npm-config(3) -- Manage the npm configuration file
+==================================================
+
+## SYNOPSIS
+
+ npm.commands.config(args, callback)
+
+## DESCRIPTION
+
+This function acts much the same way as the command-line version. The first
+element in the array tells config what to do. Possible values are:
+
+* 'set':
+ Sets a config parameter. The second element in 'args' is interpreted as the
+ key, and the third element is interpreted as the value.
+* 'get':
+ Gets the value of a config parameter. The second element in 'args' is the
+ key to get the value of.
+* 'delete' ('rm' or 'del'):
+ Deletes a parameter from the config. The second element in 'args' is the
+ key to delete.
+* 'list' ('ls'):
+ Show all configs that aren't secret. No parameters necessary.
+* 'edit':
+ Opens the config file in the default editor. This command isn't very useful
+ programmatically, but it is made available.
View
@@ -0,0 +1,20 @@
+npm-deprecate(3) -- Deprecate a version of a package
+====================================================
+
+## SYNOPSIS
+
+ npm.commands.deprecate(args, callback)
+
+## DESCRIPTION
+
+This command will update the npm registry entry for a package, providing
+a deprecation warning to all who attempt to install it.
+
+The 'args' parameter must have exactly two elements:
+
+* package@version:
+ To specify a range, wrap the version in quotes (e.g. pkg@"< 1.2")
+* message
+
+Note that you must be the package owner to deprecate something. See the
+`owner` and `adduser` help topics.
View
@@ -0,0 +1,19 @@
+npm-docs(3) -- Docs for a package in a web browser maybe
+========================================================
+
+## SYNOPSIS
+
+ npm.commands.docs(package, callback)
+
+## DESCRIPTION
+
+This command tries to guess at the likely location of a package's
+documentation URL, and then tries to open it using the `--browser`
+config param.
+
+Like other commands, the first parameter is an array. This command only
+uses the first element, which is expected to be a package name with an
+optional version number.
+
+This command will launch a browser, so this command may not be the most
+friendly for programmatic use.
View
@@ -0,0 +1,24 @@
+npm-edit(3) -- Edit an installed package
+========================================
+
+## SYNOPSIS
+
+ npm.commands.edit(package, callback)
+
+## DESCRIPTION
+
+Opens the package folder in the default editor (or whatever you've
+configured as the npm `editor` config -- see `npm help config`.)
+
+After it has been edited, the package is rebuilt so as to pick up any
+changes in compiled packages.
+
+For instance, you can do `npm install connect` to install connect
+into your package, and then `npm.commands.edit(["connect"], callback)`
+to make a few changes to your locally installed copy.
+
+The first parameter is a string array with a single element, the package
+to open. The package can optionally have a version number attached.
+
+Since this command opens an editor in a new process, be careful about where
+and how this is used.
View
@@ -0,0 +1,18 @@
+npm-explore(3) -- Browse an installed package
+=============================================
+
+## SYNOPSIS
+
+ npm.commands.explore(args, callback)
+
+## DESCRIPTION
+
+Spawn a subshell in the directory of the installed package specified.
+
+If a command is specified, then it is run in the subshell, which then
+immediately terminates.
+
+Note that the package is *not* automatically rebuilt afterwards, so be
+sure to use `npm rebuild <pkg>` if you make any changes.
+
+The first element in the 'args' parameter must be a package name. After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.
View
View
View
@@ -0,0 +1,30 @@
+npm-help-search(3) -- Search the help pages
+===========================================
+
+## SYNOPSIS
+
+ npm.commands.helpSearch(args, [silent,] callback)
+
+## DESCRIPTION
+
+This command is rarely useful, but it exists in the rare case that it is.
+
+This command takes an array of search terms and returns the help pages that
+match in order of best match.
+
+If there is only one match, then npm displays that help section. If there
+are multiple results, the results are printed to the screen formatted and the
+array of results is returned. Each result is an object with these properties:
+
+* hits:
+ A map of args to number of hits on that arg. For example, {"npm": 3}
+* found:
+ Total number of unique args that matched.
+* totalHits:
+ Total number of hits.
+* lines:
+ An array of all matching lines (and some adjacent lines).
+* file:
+ Name of the file that matched
+
+The silent parameter is not neccessary not used, but it may in the future.
View
View
@@ -0,0 +1,29 @@
+npm init(3) -- Interactively create a package.json file
+=======================================================
+
+## SYNOPSIS
+
+ npm.commands.init(args, callback)
+
+## DESCRIPTION
+
+This will ask you a bunch of questions, and then write a package.json for you.
+
+It attempts to make reasonable guesses about what you want things to be set to,
+and then writes a package.json file with the options you've selected.
+
+If you already have a package.json file, it'll read that first, and default to
+the options in there.
+
+It is strictly additive, so it does not delete options from your package.json
+without a really good reason to do so.
+
+Since this function expects to be run on the command-line, it doesn't work very
+well as a programmatically. The best option is to roll your own, and since
+JavaScript makes it stupid simple to output formatted JSON, that is the
+preferred method. If you're sure you want to handle command-line prompting,
+then go ahead and use this programmatically.
+
+## SEE ALSO
+
+npm-json(1)
View
@@ -0,0 +1,19 @@
+npm-install(3) -- install a package programmatically
+====================================================
+
+## SYNOPSIS
+
+ npm.commands.install([where,] packages, callback)
+
+## DESCRIPTION
+
+This acts much the same ways as installing on the command-line.
+
+The 'where' parameter is optional and only used internally, and it specifies
+where the packages should be installed to.
+
+The 'packages' parameter is an array of strings. Each element in the array is
+the name of a package to be installed.
+
+Finally, 'callback' is a function that will be called when all packages have been
+installed or when an error has been encountered.
View
@@ -0,0 +1,33 @@
+npm-link(3) -- Symlink a package folder
+=======================================
+
+## SYNOPSIS
+
+ npm.command.link(callback)
+ npm.command.link(packages, callback)
+
+## DESCRIPTION
+
+Package linking is a two-step process.
+
+Without parameters, link will create a globally-installed
+symbolic link from `prefix/package-name` to the current folder.
+
+With a parameters, link will create a symlink from the local `node_modules`
+folder to the global symlink.
+
+When creating tarballs for `npm publish`, the linked packages are
+"snapshotted" to their current state by resolving the symbolic links.
+
+This is
+handy for installing your own stuff, so that you can work on it and test it
+iteratively without having to continually rebuild.
+
+For example:
+
+ npm.commands.link(cb) # creates global link from the cwd
+ # (say redis package)
+ npm.commands.link('redis', cb) # link-install the package
+
+Now, any changes to the redis package will be reflected in
+the package in the current working directory
View
View
View
@@ -0,0 +1,26 @@
+npm-load(3) -- Load config settings
+===================================
+
+## SYNOPSIS
+
+ npm.load(conf, cb)
+
+## DESCRIPTION
+
+npm.load() must be called before any other function call. Both parameters are
+optional, but the second is recommended.
+
+The first parameter is an object hash of command-line config params, and the
+second parameter is a callback that will be called when npm is loaded and
+ready to serve.
+
+The first parameter should follow a similar structure as the package.json
+config object.
+
+For example, to emulate the --dev flag, pass an object that looks like this:
+
+ {
+ "dev": true
+ }
+
+For a list of all the available command-line configs, see `npm help config`
Oops, something went wrong.

0 comments on commit 001b6d0

Please sign in to comment.