del-symlinks

0.1.2 • Public • Published

del-symlinks Build Status npm

Delete symlinks using glob.

Install

$ npm install --save del-symlinks

Usage

async

const delSymlinks = require('del-symlinks');
 
delSymlinks(['/home/guntur/.*', '!/home/guntur/.*rc']).then(symlinks => {
    console.log('symlinks was deleted:\n', symlinks.join('\n'));
});

sync

const delSymlinks = require('del-symlinks');
 
const symlinks = delSymlinks.sync(['/home/guntur/*']);
 
console.log('Symlinks was deleted:\n', symlinks.join('\n'));

API

delSymlinks(patterns, [options])

Returns a promise for an array of deleted symlinks paths.

delSymlinks.sync(patterns, [options])

Returns an array of deleted symlinks paths.

  • #### patterns Type: string, array

    See supported minimatch patterns.

  • #### options Type: object

    See the node-glob options.

    · dryRun

    Type: boolean
    Default: false

    See symlinks what would be deleted instead of deleting

    delSymlinks(['/home/guntur/*', '/home/guntur/.*'], { dryRun: true }).then(symlinks => {
        console.log('Symlinks that would be deleted:\n', symlinks.join('\n'));
    });

Related

License

MIT © Guntur Poetra

Package Sidebar

Install

npm i del-symlinks

Weekly Downloads

23

Version

0.1.2

License

MIT

Last publish

Collaborators

  • guntur