Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

del

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

del - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

129

index.d.ts
import {IOptions as GlobOptions} from 'glob';
interface Options extends Readonly<GlobOptions> {
/**
* Allow deleting the current working directory and outside.
*
* @default false
*/
readonly force?: boolean;
declare namespace del {
interface Options extends Readonly<GlobOptions> {
/**
Allow deleting the current working directory and outside.
@default false
*/
readonly force?: boolean;
/**
See what would be deleted.
@default false
@example
```
import del = require('del');
(async () => {
const deletedPaths = await del(['tmp/*.js'], {dryRun: true});
console.log('Files and folders that would be deleted:\n', deletedPaths.join('\n'));
})();
```
*/
readonly dryRun?: boolean;
/**
Concurrency limit. Minimum: `1`.
@default Infinity
*/
readonly concurrency?: number;
}
}
declare const del: {
/**
* See what would be deleted.
*
* @default false
*
* @example
*
* import del from 'del';
*
* (async () => {
* const deletedPaths = await del(['tmp/*.js'], {dryRun: true});
*
* console.log('Files and folders that would be deleted:\n', deletedPaths.join('\n'));
* })();
*/
readonly dryRun?: boolean;
Delete files and folders using glob patterns.
@param patterns - See supported minimatch [patterns](https://github.com/isaacs/minimatch#usage).
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
@param options - See the [`glob` options](https://github.com/isaacs/node-glob#options).
@returns A promise for an array of deleted paths.
@example
```
import del = require('del');
(async () => {
const deletedPaths = await del(['tmp/*.js', '!tmp/unicorn.js']);
console.log('Deleted files and folders:\n', deletedPaths.join('\n'));
})();
```
*/
(
patterns: string | ReadonlyArray<string>,
options?: del.Options
): Promise<string[]>;
/**
* Concurrency limit. Minimum: `1`.
*
* @default Infinity
*/
readonly concurrency?: number;
}
Synchronously delete files and folders using glob patterns.
/**
* Delete files and folders using glob patterns.
*
* @param patterns - See supported minimatch [patterns](https://github.com/isaacs/minimatch#usage).
* - [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
* - [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
* @param options - See the [`glob` options](https://github.com/isaacs/node-glob#options).
* @returns A promise for an array of deleted paths.
*/
export default function del(
patterns: string | ReadonlyArray<string>,
options?: Options
): Promise<string[]>;
@param patterns - See supported minimatch [patterns](https://github.com/isaacs/minimatch#usage).
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
@param options - See the [`glob` options](https://github.com/isaacs/node-glob#options).
@returns An array of deleted paths.
*/
sync(
patterns: string | ReadonlyArray<string>,
options?: del.Options
): string[];
/**
* Synchronously delete files and folders using glob patterns.
*
* @param patterns - See supported minimatch [patterns](https://github.com/isaacs/minimatch#usage).
* - [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
* - [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
* @param options - See the [`glob` options](https://github.com/isaacs/node-glob#options).
* @returns An array of deleted paths.
*/
export function sync(
patterns: string | ReadonlyArray<string>,
options?: Options
): string[];
// TODO: Remove this for the next major release
default: typeof del;
};
export = del;

@@ -47,2 +47,3 @@ 'use strict';

module.exports = del;
// TODO: Remove this for the next major release
module.exports.default = del;

@@ -49,0 +50,0 @@

{
"name": "del",
"version": "4.0.0",
"version": "4.1.0",
"description": "Delete files and folders",

@@ -16,3 +16,3 @@ "license": "MIT",

"scripts": {
"test": "xo && ava && tsd-check"
"test": "xo && ava && tsd"
},

@@ -55,11 +55,11 @@ "files": [

"pify": "^4.0.1",
"rimraf": "^2.6.2"
"rimraf": "^2.6.3"
},
"devDependencies": {
"ava": "^1.2.1",
"make-dir": "^2.0.0",
"ava": "^1.4.1",
"make-dir": "^2.1.0",
"tempy": "^0.2.1",
"tsd-check": "^0.3.0",
"tsd": "^0.7.1",
"xo": "^0.24.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc