<commit_before># linklocal

### Create symlinks to local dependencies in your package.json.

Requires npm 2.0.0 and above.
Links both development and production dependencies.

## Installation

```
npm install -g linklocal
```

## Usage

```
  Usage: linklocal [options] <dir>

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    -u, --unlink           Unlink local dependencies
    -l, --link             Link local dependencies [default]
    -r, --recursive        Link recursively
    -f, --format [format]  output format

  Examples

    $ linklocal                 # link local deps in current dir
    $ linklocal -r              # link local deps recursively
    $ linklocal unlink          # unlink only in current dir
    $ linklocal unlink -r       # unlink recursively

    $ linklocal -- mydir        # link local deps in mydir
    $ linklocal unlink -- mydir # unlink local deps in mydir

  Formats

    %s: relative path to symlink
    %S: absolute path to symlink
    %h: relative real path to symlink target
    %H: absolute real path to symlink target

    relative paths are relative to cwd
```

### Linking

`linklocal` creates symlinks to any local dependencies it finds in your package.json.

```
# from test/banana
> linklocal
node_modules/apple -> ../apple

Linked 1 dependency
> ls -l node_modules
total 8
lrwxr-xr-x  1 timoxley  staff  11 20 Sep 01:39 apple -> ../../apple
```

## Unlinking

You can unlink all local links using `linklocal --unlink`.

```
# from test/banana
> linklocal --unlink
node_modules/apple -> ../apple

Unlinked 1 dependency

> ls -l node_modules

>
```

### Recursively Linking local dependencies in local dependencies

If your local dependencies might have local dependencies, you can use
`linklocal -r` to recursively link all local dependencies:

`bowl` depends on `banana`
`banana` depends on `apple`

#### With Recursion

`apple` gets linked into `banana`
```
node_modules/apple -> ../apple
node_modules/banana -> ../banana
../banana/node_modules/apple -> ../apple
node_modules/@nuts/almond -> ../almond

Linked 4 dependencies
```

#### Without Recursion

`apple` does not get linked into `banana`

```
# from test/bowl
> linklocal
node_modules/apple -> ../apple
node_modules/banana -> ../banana
node_modules/@nuts/almond -> ../almond

Linked 3 dependencies
```

## Why

npm 2.0.0 supports specifying local dependencies in your package.json:

```
> npm install --save ../apple
> cat package.json
{
  "name": "bowl",
  "version": "1.0.0",
  "dependencies": {
    "apple": "file:../apple"
  }
}
```

`npm install` will copy (and `npm install`) the package into the target's node_module's hierarchy.

This is not an ideal workflow during development as any time you modify your local dependency, you must reinstall it
in every location that depends on it. If you do not update all copies, you will have different versions of the same code, probably under the same version number.

Global `npm link` dependencies are also not ideal as packages clobber each other across projects.

By symlinking local dependencies while in development,
changes can be instantly consumed by dependees, effects
are limited to the current package and you can be more
certain local dependees are using the latest changes.

## Recommendations

`linklocal` does not install dependencies of linked dependencies. To have dependencies installed, use [timoxley/bulk](https://github.com/timoxley/bulk) in a script like:
```json
{
  "name": "my-app"
  "scripts": {
    "dev": "linklocal -r --format='%h' | sort | uniq | bulk -c 'npm install --production'",
    "prepublish": "if [[ $NODE_ENV != 'production' ]]; then npm run dev; fi"
  }
}
```

## Caveats

* `linklocal` does not install dependencies of linked dependencies, as such you typically end up installing dependencies of linked dependencies twice: once during npm install, then again after linklocal

## See Also

* [aperture](https://github.com/requireio/aperture)
* [district](https://github.com/hughsk/district)
* [symlink](https://github.com/clux/symlink)

# License

MIT<commit_msg>readme: fix bulk example<commit_after># linklocal

### Create symlinks to local dependencies in your package.json.

Requires npm 2.0.0 and above.
Links both development and production dependencies.

## Installation

```
npm install -g linklocal
```

## Usage

```
  Usage: linklocal [options] <dir>

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    -u, --unlink           Unlink local dependencies
    -l, --link             Link local dependencies [default]
    -r, --recursive        Link recursively
    -f, --format [format]  output format

  Examples

    $ linklocal                 # link local deps in current dir
    $ linklocal -r              # link local deps recursively
    $ linklocal unlink          # unlink only in current dir
    $ linklocal unlink -r       # unlink recursively

    $ linklocal -- mydir        # link local deps in mydir
    $ linklocal unlink -- mydir # unlink local deps in mydir

  Formats

    %s: relative path to symlink
    %S: absolute path to symlink
    %h: relative real path to symlink target
    %H: absolute real path to symlink target

    relative paths are relative to cwd
```

### Linking

`linklocal` creates symlinks to any local dependencies it finds in your package.json.

```
# from test/banana
> linklocal
node_modules/apple -> ../apple

Linked 1 dependency
> ls -l node_modules
total 8
lrwxr-xr-x  1 timoxley  staff  11 20 Sep 01:39 apple -> ../../apple
```

## Unlinking

You can unlink all local links using `linklocal --unlink`.

```
# from test/banana
> linklocal --unlink
node_modules/apple -> ../apple

Unlinked 1 dependency

> ls -l node_modules

>
```

### Recursively Linking local dependencies in local dependencies

If your local dependencies might have local dependencies, you can use
`linklocal -r` to recursively link all local dependencies:

`bowl` depends on `banana`
`banana` depends on `apple`

#### With Recursion

`apple` gets linked into `banana`
```
node_modules/apple -> ../apple
node_modules/banana -> ../banana
../banana/node_modules/apple -> ../apple
node_modules/@nuts/almond -> ../almond

Linked 4 dependencies
```

#### Without Recursion

`apple` does not get linked into `banana`

```
# from test/bowl
> linklocal
node_modules/apple -> ../apple
node_modules/banana -> ../banana
node_modules/@nuts/almond -> ../almond

Linked 3 dependencies
```

## Why

npm 2.0.0 supports specifying local dependencies in your package.json:

```
> npm install --save ../apple
> cat package.json
{
  "name": "bowl",
  "version": "1.0.0",
  "dependencies": {
    "apple": "file:../apple"
  }
}
```

`npm install` will copy (and `npm install`) the package into the target's node_module's hierarchy.

This is not an ideal workflow during development as any time you modify your local dependency, you must reinstall it
in every location that depends on it. If you do not update all copies, you will have different versions of the same code, probably under the same version number.

Global `npm link` dependencies are also not ideal as packages clobber each other across projects.

By symlinking local dependencies while in development,
changes can be instantly consumed by dependees, effects
are limited to the current package and you can be more
certain local dependees are using the latest changes.

## Recommendations

`linklocal` does not install dependencies of linked dependencies. To have dependencies installed, use [timoxley/bulk](https://github.com/timoxley/bulk) in a script like:
```json
{
  "name": "my-app",
  "scripts": {
    "dev": "linklocal -r --format='%h' | sort | uniq | bulk -c 'npm install --production'",
    "prepublish": "if [[ $NODE_ENV != 'production' ]]; then npm run dev; fi"
  }
}
```

## Caveats

* `linklocal` does not install dependencies of linked dependencies, as such you typically end up installing dependencies of linked dependencies twice: once during npm install, then again after linklocal

## See Also

* [aperture](https://github.com/requireio/aperture)
* [district](https://github.com/hughsk/district)
* [symlink](https://github.com/clux/symlink)

# License

MIT
{'fraction_non_alphanumeric': 0.1057204923968139, 'fraction_numerical': 0.005551532705768767, 'mean_word_length': 3.2716494845360824, 'pattern_counts': {'":': 16, '<': 5, '<?xml version=': 0, '>': 41, 'https://': 8, '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': '3561484', 'n_tokens_mistral': 2524, 'n_tokens_neox': 2379, 'n_words': 962}