Gathering detailed insights and metrics for del
Gathering detailed insights and metrics for del
Gathering detailed insights and metrics for del
Gathering detailed insights and metrics for del
unset-value
Delete nested properties from an object using dot notation.
base
Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks
del-cli
Delete files and directories - Cross-platform
micromark-extension-gfm-strikethrough
micromark extension to support GFM strikethrough
npm install del
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.3
Supply Chain
98.9
Quality
76.3
Maintenance
100
Vulnerability
100
License
JavaScript (94.88%)
TypeScript (5.12%)
Total Downloads
4,389,818,299
Last Day
918,547
Last Week
5,666,196
Last Month
46,290,876
Last Year
691,530,637
1,330 Stars
125 Commits
65 Forks
20 Watching
2 Branches
24 Contributors
Latest Version
8.0.0
Package Id
del@8.0.0
Unpacked Size
12.33 kB
Size
3.97 kB
File Count
5
NPM Version
10.6.0
Node Version
22.6.0
Publised On
07 Oct 2024
Cumulative downloads
Total Downloads
Last day
-17.4%
918,547
Compared to previous day
Last week
-44.2%
5,666,196
Compared to previous week
Last month
-22%
46,290,876
Compared to previous month
Last year
-3.1%
691,530,637
Compared to previous year
Delete files and directories using globs
Similar to rimraf, but with a Promise API and support for multiple files and globbing. It also protects you against deleting the current working directory and above.
1npm install del
1import {deleteAsync} from 'del'; 2 3const deletedFilePaths = await deleteAsync(['temp/*.js', '!temp/unicorn.js']); 4const deletedDirectoryPaths = await deleteAsync(['temp', 'public']); 5 6console.log('Deleted files:\n', deletedFilePaths.join('\n')); 7console.log('\n\n'); 8console.log('Deleted directories:\n', deletedDirectoryPaths.join('\n'));
The glob pattern **
matches all children and the parent.
So this won't work:
1deleteSync(['public/assets/**', '!public/assets/goat.png']);
You have to explicitly ignore the parent directories too:
1deleteSync(['public/assets/**', '!public/assets', '!public/assets/goat.png']);
To delete all subdirectories inside public/
, you can do:
1deleteSync(['public/*/']);
Suggestions on how to improve this welcome!
Note that glob patterns can only contain forward-slashes, not backward-slashes. Windows file paths can use backward-slashes as long as the path does not contain any glob-like characters, otherwise use path.posix.join()
instead of path.join()
.
Returns Promise<string[]>
with the deleted paths.
Returns string[]
with the deleted paths.
Type: string | string[]
See the supported glob patterns.
Type: object
You can specify any of the globby
options in addition to the below options. In contrast to the globby
defaults, expandDirectories
, onlyFiles
, and followSymbolicLinks
are false
by default.
Type: boolean
Default: false
Allow deleting the current working directory and outside.
Type: boolean
Default: false
See what would be deleted.
1import {deleteAsync} from 'del'; 2 3const deletedPaths = await deleteAsync(['temp/*.js'], {dryRun: true}); 4 5console.log('Files and directories that would be deleted:\n', deletedPaths.join('\n'));
Type: boolean
Default: false
Allow patterns to match files/folders that start with a period (.
).
This option is passed through to fast-glob
.
Note that an explicit dot in a portion of the pattern will always match dot files.
Example
directory/
├── .editorconfig
└── package.json
1import {deleteSync} from 'del'; 2 3deleteSync('*', {dot: false}); 4//=> ['package.json'] 5deleteSync('*', {dot: true}); 6//=> ['.editorconfig', 'package.json']
Type: number
Default: Infinity
Minimum: 1
Concurrency limit.
Type: (progress: ProgressData) => void
Called after each file or directory is deleted.
1import {deleteAsync} from 'del'; 2 3await deleteAsync(patterns, { 4 onProgress: progress => { 5 // … 6}});
1{ 2 totalCount: number, 3 deletedCount: number, 4 percent: number, 5 path?: string 6}
percent
is a value between 0
and 1
path
is the absolute path of the deleted file or directory. It will not be present if nothing was deleted.See del-cli for a CLI for this module and trash-cli for a safe version that is suitable for running by hand.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 12/30 approved changesets -- score normalized to 4
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More