# watchwomen

> Replaces npm link with something that actually works!

Latest version **2.0.1** (published 2020-06-04) · MIT license · 0 weekly downloads

## Install

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

Provides the command `watchwomen`.

## 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 | 2.0.1 |
| Published | 2020-06-04 |
| First published | 2020-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 63 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | nomi9995 |
| Maintainers | nomi9995 |

## Links

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

## Dependencies (15)

- [q](https://npm.io/package/q.md) ^1.4.1
- [glob](https://npm.io/package/glob.md) ^7.1.2
- [yargs](https://npm.io/package/yargs.md) ^12.0.1
- [colors](https://npm.io/package/colors.md) ^1.1.2
- [extend](https://npm.io/package/extend.md) ^3.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [uuid-js](https://npm.io/package/uuid-js.md) ^0.7.5
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.30.0
- [fs-utils](https://npm.io/package/fs-utils.md) ^0.7.0
- [inquirer](https://npm.io/package/inquirer.md) ^1.2.3
- [is-there](https://npm.io/package/is-there.md) ^4.3.3
- [columnify](https://npm.io/package/columnify.md) ^1.5.4
- [untildify](https://npm.io/package/untildify.md) ^3.0.2
- [fb-watchman](https://npm.io/package/fb-watchman.md) ^1.9.0
- [promise-sequential](https://npm.io/package/promise-sequential.md) ^1.1.1

## Recent versions

- 2.0.1 (latest) — 2020-06-04
- 2.0.0 — 2020-06-04

## README

# <img src="media/logo.png" width="72">

# NOTICE: Actual create is [wix/wml](http://github.com/wix/wml), due to apparant lack of updates. It contains fixes and enhancements. I will continue to pull updates from upstream.

> Tangible symlinks

watchwomen listens to changes in some folder (using [Watchman](https://facebook.github.io/watchman/)) and copies changed files into another folder.

## Why?

Let's face it, sometimes symbolic links just aren't enough. Github has more than [10K issues](https://github.com/search?utf8=✓&q=support+for+symlinks&type=Issues) with the words "support for symlinks" in them.

Two examples I've encountered so far were: React Native's packager [lack of support for them](https://github.com/facebook/react-native/issues/637) and Webpack's [inability to find linked modules dependencies](http://webpack.github.io/docs/troubleshooting.html#npm-linked-modules-doesn-t-find-their-dependencies) (working around this has issues of its own). A lot of people resolve to working directly from the node*modules folder in these cases, but \_a.* if your package is required by two projects on which you are working simultaneously, you're screwed, and _b._ it just feels wrong.

watchwomen makes use of Facebook's ultra-fast Watchman to watch for changes in your source folder and copy them (and only them) into your destination folder.

watchwomen is a CLI tool that works pretty much like `ln -s`. You first set up your links by using the `watchwomen add` command and then run the watchwomen service (`watchwomen start`) to start listening. That's it!

Note that since watchwomen is based on Watchman it **does not support symlinks**. lol.

## Install

```sh
npm install -g watchwomen
```

## Usage

```sh
# add the link to watchwomen using `watchwomen add <src> <dest>`
watchwomen add ~/my-package ~/main-project/node_modules/my-package

# start watching all links added
watchwomen start
```

## Commands

#### add

`watchwomen add <src> <dest>` (or `watchwomen a`)

#### skip ignor prompt

`watchwomen add <src> <dest> --skip-prompt`

Adds a link.

watchwomen will not start listening to changes until you start it by running `watchwomen start`.

Each link is given an unique id, you can see all links and their ids by running `watchwomen list`.
Links are saved to `src/links.json` in your `watchwomen` install directory, meaning that
your configuration is specific to that `watchwomen` install.

#### autoAdd

`watchwomen autoAdd <repo_root>` (or `watchwomen aa`)

Automatically links packages used in this project with packages in a given repos folder.

This is the power command: when you have many packages that you develop locally across your projects,
you normally keep them in one root folder. When you start a new project and `npm install` one of your packages,
use `watchwomen aa` and watchwomen will see match your local package to the package in your repo root.

#### rm

`watchwomen rm <linkId> [<linkId>...]`

Removes one or more links. Passing `all` as linkId removes all links.

#### start

`watchwomen start` (or `watchwomen s`)

Starts watchwomen.

It first copies all watched files from source to destination folder and then waits for new changes to happen.

#### list

`watchwomen list [--src|--dst` (or `watchwomen ls`)

Lists all links, optionally sorting by source or destination paths.

Shows each link's id, state and source/destination folders.

#### enable

`watchwomen enable [linkId]` (or `watchwomen en`)

Enables a link. Passing `all` as linkId enables all links.

If you don't specify a linkId watchwomen will open in interactive mode.

#### disable

`watchwomen disable [linkId]` (or `watchwomen d`)

Disables a link. Passing `all` as linkId disabled all links.

If you don't specify a linkId watchwomen will open in interactive mode.

Great for re-using old links without having to type them over and over again.

## Miscellaneous

#### Ignored folders

When adding a new link watchwomen will try to detect if your source folder is a git repository or an npm package, it will then offer to ignore the ".git" and "node_modules" folders for you.

If you want to add more folders to your ignored folders first create a file named `.watchmanconfig` in your source folder, this file should contain Watchman's configuration for this folder. See example below to learn how populate it or check out the [Watchman docs](https://facebook.github.io/watchman/docs/config.html) to learn more about Watchman configurations.

In the following example we are ignoring the ".git" and "node_modules" folders:

```json
{
  "ignore_dirs": [".git", "node_modules"]
}
```

## Contributing

See the [Contributing page](CONTRIBUTING.md).

## License

Copyright (c) 2016 Wix. Licensed under the MIT license.

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