Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iguntur/del-symlinks
Delete symlinks using glob
https://github.com/iguntur/del-symlinks
Last synced: about 11 hours ago
JSON representation
Delete symlinks using glob
- Host: GitHub
- URL: https://github.com/iguntur/del-symlinks
- Owner: iguntur
- License: mit
- Created: 2016-10-17T04:21:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-14T22:27:52.000Z (almost 8 years ago)
- Last Synced: 2024-10-31T19:36:03.691Z (7 days ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# del-symlinks [![Build Status](https://travis-ci.org/iguntur/del-symlinks.svg?branch=master)](https://travis-ci.org/iguntur/del-symlinks)
> Delete symlinks using [glob](https://github.com/isaacs/minimatch#usage).
## Install
``` bash
$ npm install --save del-symlinks
```## Usage
**async**
``` js
const delSymlinks = require('del-symlinks');delSymlinks(['/home/guntur/.*', '!/home/guntur/.*rc']).then(symlinks => {
console.log('symlinks was deleted:\n', symlinks.join('\n'));
});
```**sync**
```js
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](https://github.com/isaacs/minimatch#usage).
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test.js)
- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)- #### options
Type: `object`See the `node-glob` [options](https://github.com/isaacs/node-glob#options).
**· dryRun**
Type: `boolean`
Default: `false`See symlinks what would be deleted instead of deleting
```js
delSymlinks(['/home/guntur/*', '/home/guntur/.*'], { dryRun: true }).then(symlinks => {
console.log('Symlinks that would be deleted:\n', symlinks.join('\n'));
});
```## Related
- [del-symlinks-cli](https://github.com/iguntur/del-symlinks-cli) - Delete symbolic link (symlinks) CLI
- [get-symlinks](https://github.com/iguntur/get-symlinks) - Get all symbolic link in directory
- [is-symbolic-link](https://github.com/iguntur/is-symbolic-link) - Check if PATH is symbolic link## License
MIT © [Guntur Poetra](http://guntur.starmediateknik.com)