<commit_before># npm – The Node Package Manager

npm is a little package manager for the Node javascript library.

## 5-Second(ish) Install

You should already have node installed and working.  If you don't, go do that first.

Then, come back here, and run:

    ./install.js

and it'll install itself and its requirements.

## Commands

You can get more details on any of these by doing `npm <command> --help`.  Here are the basics.

All flags with two hyphens can be abbreviated to a single hyphen with the first letter, so you can also do `npm <command> -h` to get its info.

All commands return 0 if they succeed, and usually 1 if they don't.  Normal output is on stdout, and oddness goes to stderr.  Use the `--verbose` flag with any command to send extra debugging output to stderr.

### Managing Sources

npm learns all it knows about packages by looking at the JSON files specified in its catalog list.  Manage this catalog list via the `npm source` commands.

Source URLs can contain `{tokens}` which are expanded based on what's being installed.  Currently only `{name}` is supported, but `{version}` and `{branch}` are planned.


### Update Package Metadata

Fetch the latest info from every source by doing `npm refresh`.  Throw a `--force` on there if you want to clear the cache first.

It's a good idea to update every so often, maybe even put it on a weekly cron or something.

    @TODO: Keep track of which packages were updated, and then
    add them to an "outdated" list.  Then, `npm update` could
    be an alias to `npm refresh && npm install --force --outdated`

### Update Package Code

Version numbers aren't yet supported, so npm can't tell when a package has new code for you. If you know that it does, you can do `npm install --force <package>` to force-install the latest version.

### Find a Package

Find a package in the list by doing `npm search <string>`.  If you only want to search through installed packages, then do `npm search --installed <string>`.  If you only want to search through activated packages, then do `npm search --active <string>`.

### Activating/Deactivating Packages

Use `npm activate <package>`.  Note that installing a package activates it by default, and uninstalling it deactivates it first.

### Starting/stopping Packages

Some packages are servers and the like that must be activated after being installed.  To do this, do `npm start <package>`.  To stop it, do `npm stop <package>`.

### Remove a Package

You can uninstall a package by doing `npm remove <package>`.  This will first `stop` it if it's running, then remove its files from your system.

## Setting Defaults and Aliases via `$HOME/.npmrc`

Gee, it'd sure be nice to be able to have a `$HOME/.npmrc` file that could maybe pre-fix some of these options, dotcha think?

Write it, and send me a pull request, kthx.<commit_msg>A better, stronger README.  For the future.<commit_after># npm – The Node Package Manager

npm is a little package manager for the Node javascript library.

For now, this README is more of a task list/roadmap than a proper "how to use this" type doc.

## Goal for current iteration

Given a name, and a url of a tarball containing a npm-package.json, install it.

where "install it" means:

1. fetch the tarball
2. unpack
3. copy it to `ROOT/<name>/npm/`  
  If it already exists, then insist that it be uninstalled first.
4. read and parse the npm-package.json
5. link `ROOT/<name>/index.js` to `ROOT/<name>/package/<lib>`, if there is one.
6. Run the `build` command in the package dir (sh)

## Next Iteration

* Keep a registry of what's been installed, and what tarball it came from.  Maybe something like `ROOT/<name>/from` or something.
* Add an "uninstall" command that deletes the folder for a package.
* Add a "reinstall" command that re-fetches a tarball and installs it with the same name as before

## Future

* Support an "uninstall" command on the package.json, and run it when uninstalling.
* Support "requires" which is a list of tarball urls that must be installed first.
* Figure out how to manage requirements without it being a total cluster.
* Replace the reliance on tarballs with a list of names that REFER to tarballs
* Versions.  Be able to install and activate different versions, have a url for the version info to update when necessary.
* Make a pizza and serve it up.
* The kitchen sink.


{'fraction_non_alphanumeric': 0.07231121281464531, 'fraction_numerical': 0.002059496567505721, 'mean_word_length': 3.8085808580858087, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2290377', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1177, 'n_words': 704}