# nswap

> Swap node_modules between Windows and LXSS

Latest version **1.0.0** (published 2016-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install nswap
pnpm add nswap
yarn add nswap
bun add nswap
```

Provides the command `nswap`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-12-14 |
| First published | 2016-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Coridyn |
| Maintainers | coridyn |
| Keywords | node_modules, Windows, LXSS |

## Links

- npm: https://www.npmjs.com/package/nswap
- Repository: https://github.com/Coridyn/nswap
- Homepage: https://github.com/Coridyn/nswap#readme
- Issues: https://github.com/Coridyn/nswap/issues
- npm.io page: https://npm.io/package/nswap

## Dependencies (2)

- [nopt](https://npm.io/package/nopt.md) ^4.0.0
- [chalk](https://npm.io/package/chalk.md) ^1.1.3

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-12-14
- 0.0.1 — 2016-12-14

## README

Share your project between Windows and Bash on Windows (also known as Ubuntu on Windows or LXSS) and swap between different `node_module` directories.

If you have a
 

## Installation

```bash
$ npm install -g nswap
```

This will give you a global `nswap` command that you can use in any project directory.


You'll probably want to add `node_modules-win` and `node_modules-lxss` to your `.gitignore` (either local or global).


## USAGE


### --info

print out info about current project directory

```bash
$ nswap --info
"node_modules" is a directory - run "nswap --init"
```

```bash
$ nswap --info
"node_modules" is linked to "node_modules-win"
```

```bash
$ nswap --info
"node_modules" is probably linked to "node_modules-lxss"
```

```bash
$ nswap --info
"node_modules" doesn't exist
```

### --init

rename existing `node_modules` to platform-specific directory (renames to `node_modules-win` or `node_modules-lxss`)

Run this command in a project directory before running `--link`

```bash
$ nswap --init
moving "node_modules" to "node_modules-win"
```


### --link

link the platform-appropriate directory as `node_modules`

In Windows:

```bash
$ nswap --link
activating win32
```

In LXSS:

```bash
$ nswap --link
activating *nix
```

__NOTE:__ This needs to be run from within the environment that needs the link.

e.g. Windows will only link the `node_modules-win` and *nix will only link `node_modules-lxss`.
Because of the way the filesystem works Windows _cannot_ link `node_modules-lxss` -> `node_modules`


### --unlink

remove the `node_modules` link (either Windows junction or *nix symlink).

```bash
$ nswap --unlink
unlinked "node_modules"
```

It won't delete your real `node_modules` directory:

```bash
$ nswap --unlink
"node_modules" already exists as a real directory. Move or delete this to continue.
```

If there is no output then the link didn't exist and nothing was done.


## Cleanup

If you want to

---
_Source: https://npm.io/package/nswap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
