{"id":15655533,"url":"https://github.com/jonschlinkert/delete","last_synced_at":"2025-10-08T08:53:52.435Z","repository":{"id":18184483,"uuid":"21300582","full_name":"jonschlinkert/delete","owner":"jonschlinkert","description":"Delete files and folders and any intermediate directories if they exist (sync and async).","archived":false,"fork":false,"pushed_at":"2017-07-02T04:40:47.000Z","size":31,"stargazers_count":24,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T22:48:27.212Z","etag":null,"topics":["del","delete","file","file-system","fs","glob","match","remove"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-28T10:24:39.000Z","updated_at":"2024-04-03T03:02:39.000Z","dependencies_parsed_at":"2022-09-10T22:50:54.649Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/delete","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fdelete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fdelete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fdelete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fdelete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/delete/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251666132,"owners_count":21624290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["del","delete","file","file-system","fs","glob","match","remove"],"created_at":"2024-10-03T12:59:39.873Z","updated_at":"2025-10-08T08:53:47.385Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","readme":"# delete [![NPM version](https://img.shields.io/npm/v/delete.svg?style=flat)](https://www.npmjs.com/package/delete) [![NPM monthly downloads](https://img.shields.io/npm/dm/delete.svg?style=flat)](https://npmjs.org/package/delete) [![NPM total downloads](https://img.shields.io/npm/dt/delete.svg?style=flat)](https://npmjs.org/package/delete) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/delete.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/delete)\n\n\u003e Delete files and folders and any intermediate directories if they exist (sync and async).\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save delete\n```\n\n## Usage\n\n```js\nvar del = require('delete');\n\n// async\ndel(['foo/*.js'], function(err, deleted) {\n  if (err) throw err;\n  // deleted files\n  console.log(deleted);\n});\n\n// sync\ndel.sync(['foo/*.js']);\n\n// promise\ndel.promise(['foo/*.js'])\n  .then(function(deleted) {\n    // deleted files\n    console.log(deleted)\n  });\n```\n\n## Options\n\nAll methods take an `options` object as the second argument.\n\n### options.force\n\n**Type**: `boolean`\n\n**Default**: `undefined`\n\nBy default, error is thrown if you try to delete either the current working directory itself, or files outside of the current working directory (e.g. parent directories).\n\n**Examples**\n\n```js\ndel.sync('../foo.md', {force: true});\n\ndel('.', {force: true}, function(err, files) {\n  // do stuff with err\n  console.log(files);\n});\n\ndel.promise('./', {force: true})\n  .then(function(files) {\n    console.log(files);\n  })\n```\n\n_(This option was inspired by settings in [grunt](http://gruntjs.com/).)_\n\n## About\n\n### Related projects\n\n* [copy](https://www.npmjs.com/package/copy): Copy files or directories using globs. | [homepage](https://github.com/jonschlinkert/copy \"Copy files or directories using globs.\")\n* [export-files](https://www.npmjs.com/package/export-files): node.js utility for exporting a directory of files as modules. | [homepage](https://github.com/jonschlinkert/export-files \"node.js utility for exporting a directory of files as modules.\")\n* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch \"Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.\")\n* [write](https://www.npmjs.com/package/write): Write files to disk, creating intermediate directories if they don't exist. | [homepage](https://github.com/jonschlinkert/write \"Write files to disk, creating intermediate directories if they don't exist.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 02, 2017._","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fdelete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fdelete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fdelete/lists"}