# dir_watchdog

> This is a directory watchdog tool.

Latest version **1.0.0** (published 2015-04-20) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2015-04-20 |
| First published | 2015-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ChrisSheu |
| Maintainers | chris_sheu |
| Keywords | directory, folder, sync, detect, watchdog, refresh |

## Links

- npm: https://www.npmjs.com/package/dir_watchdog
- Repository: https://github.com/ChrisSheu/npm-git/tree/dir_watchdog
- Issues: https://github.com/ChrisSheu/npm-git/issues
- npm.io page: https://npm.io/package/dir_watchdog

## Dependencies (3)

- [fs](https://npm.io/package/fs.md) 0.0.2
- [readdirp](https://npm.io/package/readdirp.md) ~1.3.0
- [array-difference](https://npm.io/package/array-difference.md) 0.0.1

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-04-20
- 0.0.4 (0.0.4) — 2015-04-19
- 0.0.2 (0.0.2) — 2015-04-19
- 0.0.7 — 2015-04-20
- 0.0.6 — 2015-04-20
- 0.0.5 — 2015-04-19
- 0.0.1 — 2015-04-17

## README

## dir_watchdog

[![PayPayl donate button](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JCT98Z2B5WMM8 "Donate once-off to this project using Paypal")
![npm version](https://img.shields.io/badge/npm-1.4.28-red.svg)
![fs version](https://img.shields.io/badge/fs-0.0.2-lightgray.svg)
![array-difference version](https://img.shields.io/badge/array--difference-0.0.1-yellow.svg)
![readdirp version](https://img.shields.io/badge/readdirp-1.3.0-green.svg)


* This is a directory/folder watchdog tool.

## Overview

* [Getting Started](#getting-started)
  - install
* [Usage](#usage)
* [Result](#result)
* [License](#license)

## Getting Started
   npm install dir_watchdog

## Usage
```
var dw = require('dir_watchdog');
var option = new Object();
option.rootpath = "./myfile";             //default path : "./"
option.timer = 1000;                        //default : 2000 millionseconds detect.
dw.watchdog(option, function(ret, files, dirs)
{
  //catch event msg.
  switch(ret)
  {
      case "init":
        showlog(ret, files, dirs);
        break;
      case "create":
        showlog(ret, files, dirs);
        break;
      case "delete":
        showlog(ret, files, dirs);
        break;
      case "change":
        showlog(ret, files, dirs);
        break;
      default:
        break;
  }
});
function showlog(ret, files, dirs)
{
    console.log(ret);
    console.log("=====files=====");
    console.log(files);
    console.log("=====directories=====");
    console.log(dirs);
}
```
## Result
* init:
<div> 
<img src="https://github.com/ChrisSheu/npm-git/blob/dir_watchdog/docs/init.PNG?raw=true" align="left|bottom" height="150" width="600">
</div>
* create: ( hello file)
<div> 
<img src="https://github.com/ChrisSheu/npm-git/blob/dir_watchdog/docs/create.PNG?raw=true" align="left|bottom" height="150" width="600">
</div>
* delete: ( hello file)
<div> 
<img src="https://github.com/ChrisSheu/npm-git/blob/dir_watchdog/docs/delete.PNG?raw=true" align="left|bottom" height="150" width="600">
</div>
* change[rename]: ( hello -> hello_rename file)
<div> 
<img src="https://github.com/ChrisSheu/npm-git/blob/dir_watchdog/docs/change_rename.PNG?raw=true" align="left|bottom" height="150" width="600">
</div>
* change[move]:  ( ../myfile/hello_rename → ../myfile/test/hello__rename file)
<div> 
<img src="https://github.com/ChrisSheu/npm-git/blob/dir_watchdog/docs/change_move.PNG?raw=true" align="left|bottom" height="150" width="600">
</div>

## License

* SEE　[![Linence](https://img.shields.io/apm/l/vim-mode.svg)](http://www.opensource.org/licenses/MIT)

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