1 | # {%= name %} {%= badge("fury") %}
|
2 |
|
3 | > {%= description %}
|
4 |
|
5 | Also see
|
6 | * [del](https://github.com/sindresorhus/del) if you need globbing. This lib was inspired by **del**, I wanted a quick solution that prevented accidental deletion of files outside the current working directory, but for individual files and without the extra dependencies.
|
7 | * [write](https://github.com/jonschlinkert/write) for writing files to disk.
|
8 |
|
9 | ## Install
|
10 | {%= include("install") %}
|
11 |
|
12 | ## Usage
|
13 |
|
14 | ```js
|
15 | var del = require('delete');
|
16 |
|
17 | // delete files asynchronously
|
18 | del('tmp/foo.md', function(err) {
|
19 | if (err) {throw err;}
|
20 | });
|
21 |
|
22 | // delete files synchronously
|
23 | del.sync('tmp/foo.md');
|
24 | ```
|
25 |
|
26 | ### options.force
|
27 |
|
28 | An error is thrown if you try to delete files outside of the current working directory (cwd).
|
29 |
|
30 | Override the default behavior:
|
31 |
|
32 | ```js
|
33 | del.sync('../foo.md', {force: true});
|
34 | ```
|
35 |
|
36 | ## Author
|
37 | {%= include("author") %}
|
38 |
|
39 | ## License
|
40 | {%= copyright() %}
|
41 | {%= license() %}
|
42 |
|
43 | ***
|
44 |
|
45 | {%= include("footer") %} |
\ | No newline at end of file |