0.1.0 • Published 9 years ago

unlink-broken-links v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

unlink-broken-links Build Status

Find broken symlinks and destroy them

Install

$ npm install -g unlink-broken-links

Usage

unlink-broken-links [directory]

Options:
  --version        Show version number                                 [boolean]
  --recursive, -r  Recursively walk the directory     [boolean] [default: false]
  --help, -h       Show help                                           [boolean]

Programmatic API

var unlinkBrokenLinks = require('unlink-broken-links');

// "recursive" defaults to false
unlinkBrokenLinks('/some/path', {recursive: true})
  .then(function(result) {
    console.log(result.removed); // array of removed files (if any)
    console.log(result.errors); // array of errors (if any)
  });

// or callback-style
unlinkBrokenLinks('/some/path', {recursive: true}, function(err, result) {
  // "err" will only be truthy if something's terribly wrong 
  console.log(result.removed); // array of removed files (if any)
  console.log(result.errors); // array of errors (if any)
});

License

© 2015 Christopher Hiller. Licensed MIT.