Comparing version 0.1.3 to 0.1.4
@@ -16,3 +16,10 @@ # {%= name %} {%= badge("fury") %} | ||
var del = require('delete'); | ||
del('tmp/'); | ||
// delete files asynchronously | ||
del('tmp/foo.md', function(err) { | ||
if (err) {throw err;} | ||
}); | ||
// delete files synchronously | ||
del.sync('tmp/foo.md'); | ||
``` | ||
@@ -27,3 +34,3 @@ | ||
```js | ||
del('../foo', {force: true}); | ||
del.sync('../foo.md', {force: true}); | ||
``` | ||
@@ -30,0 +37,0 @@ |
{ | ||
"name": "delete", | ||
"description": "Delete files and folders.", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"homepage": "https://github.com/jonschlinkert/delete", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -20,3 +20,10 @@ # delete [![NPM version](https://badge.fury.io/js/delete.png)](http://badge.fury.io/js/delete) | ||
var del = require('delete'); | ||
del('tmp/'); | ||
// delete files asynchronously | ||
del('tmp/foo.md', function(err) { | ||
if (err) {throw err;} | ||
}); | ||
// delete files synchronously | ||
del.sync('tmp/foo.md'); | ||
``` | ||
@@ -31,3 +38,3 @@ | ||
```js | ||
del('../foo', {force: true}); | ||
del.sync('../foo.md', {force: true}); | ||
``` | ||
@@ -34,0 +41,0 @@ |
@@ -19,8 +19,21 @@ /*! | ||
describe('delete:', function () { | ||
it('should delete files.', function () { | ||
var fixture = 'test/fixtures/a.txt'; | ||
expect(fs.existsSync(fixture)).to.be.true; | ||
del.sync('test/fixtures'); | ||
expect(fs.existsSync(fixture)).to.be.false; | ||
describe('async:', function () { | ||
it('should delete files asynchronously.', function () { | ||
var fixture = 'test/fixtures/a.txt'; | ||
expect(fs.existsSync(fixture)).to.be.true; | ||
del('test/fixtures', function(err) { | ||
if (err) {throw err;} | ||
expect(fs.existsSync(fixture)).to.be.false; | ||
}); | ||
}); | ||
}); | ||
describe('sync:', function () { | ||
it('should delete files synchronously.', function () { | ||
var fixture = 'test/fixtures/a.txt'; | ||
expect(fs.existsSync(fixture)).to.be.true; | ||
del.sync('test/fixtures'); | ||
expect(fs.existsSync(fixture)).to.be.false; | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7355
66
53