# lnwatch

> Small utility for node, to watch symlink changes.

Latest version **1.0.10** (published 2015-06-01) · MIT license · 0 weekly downloads

## Install

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

## 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.10 |
| Published | 2015-06-01 |
| First published | 2015-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | nec@shell8.net |
| Maintainers | nec |
| Keywords | symlink, ln, watch, observe, soft, link |

## Links

- npm: https://www.npmjs.com/package/lnwatch
- Repository: https://github.com/necccc/lnwatch
- Issues: https://github.com/necccc/lnwatch/issues
- npm.io page: https://npm.io/package/lnwatch

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 1.0.10 (latest) — 2015-06-01
- 1.0.9 — 2015-06-01
- 1.0.8 — 2015-06-01

## README

# lnwatch

[![Build Status](https://travis-ci.org/necccc/lnwatch.svg?branch=master)](https://travis-ci.org/necccc/lnwatch)

Small utility for node, to watch symlink changes.

---

### Usage

```
var lnw = require('../lnwatch.js')

lnw.on('change', function (data) {
	console.log('LINK CHANGED', data);
})

lnw.add([
	'./foo',
	'./qux',  // nonexistent link, ignored
	'./bar'
])

```

### Methods

##### lnwatch.add(links)

Add links to watch, can be a single link path string, or several in an array.
Nonexistent links will be ignored.

##### lnwatch.remove([links])

Remove watched links, can be a single link path string, or several in an array.
Nonexistent links will be ignored.

##### lnwatch.removeAll()

Remove all watched links.

### Events

##### lnw.on('change', callback)

Fired when one of the watched link changes target. Receives data about what changed:

- which link, 
- from what target, 
- to which target 

**Example:**


```

lnw.on('change', function (data) {
	console.log(data);
})

/* 

outputs:

{ 
  link: '/Users/nec/github/lnwatch/tests/bar',
  from: '/Users/nec/github/lnwatch/tests/two',
  to: '/Users/nec/github/lnwatch/tests/three' 
}

*/

```

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