fs-util
Incremental utilities for NodeJS File System API.
Last updated 7 years ago by arboleya .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fs-util 
SYNC missed versions from official npm registry.

Incremental utilities for NodeJS File System API.

Build Status

FS Tree Watcher

Provides the ability to watch an entire tree of folders and files.

  • Events:
  • watch
  • unwatch
  • create
  • change
  • delete

Usage

fsu = require 'fs-util'
watcher = fsu.watch 'desired/path', /.coffee$/m
watcher.on 'watch', (f)-> console.log 'WATCHED ' + [f.type, f.location]
watcher.on 'unwatch', (f)-> console.log 'UNWATCHED ' + [f.type, f.location]
watcher.on 'create', (f)-> console.log 'CREATED ' + [f.type, f.location]
watcher.on 'change', (f)-> console.log 'CHANGED ' + [f.type, f.location]
watcher.on 'delete', (f)-> console.log 'DELETED ' + [f.type, f.location]

Arguments

All callbacks receives one argument which is the related item to the event.

It has the following properties:

[item].location

Fullpath location of the item.

[item].type

Item type, can be dir or file.

[item].prev

Last stat of the file, it's an instance of fs.Stats.

[item].curr

Current stat of the file, it's an instance of fs.Stats.

[item].tree

The complete tree of subitems (files and folders) under that point.

  • Applies only when item.type is folder

Installing

npm install fs-util

Developing

cd fs-util && npm install

Building

make build

Testing

make test

TODO

List of TODO features besides the current [FS Tree Watcher].watch:

  • mkdir [-p]
  • rm [-r] [-f]
  • search
  • cp [-r]
  • mv

Note: There are also some tests to be finished and tested across different platforms, such as Osx, Linux and Windows.

Current Tags

  • 0.3.17                                ...           latest (7 years ago)

19 Versions

  • 0.3.17                                ...           7 years ago
  • 0.3.16                                ...           7 years ago
  • 0.3.15                                ...           7 years ago
  • 0.3.14                                ...           7 years ago
  • 0.3.13                                ...           7 years ago
  • 0.3.12                                ...           7 years ago
  • 0.3.11                                ...           7 years ago
  • 0.3.10                                ...           7 years ago
  • 0.3.8                                ...           7 years ago
  • 0.3.7                                ...           7 years ago
  • 0.3.6                                ...           7 years ago
  • 0.3.5                                ...           7 years ago
  • 0.3.4                                ...           7 years ago
  • 0.3.3                                ...           7 years ago
  • 0.3.2                                ...           7 years ago
  • 0.3.1                                ...           7 years ago
  • 0.3.0                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |