3.11.116 • Published 2 months ago

@taktikorg/placeat-voluptates-dolorum v3.11.116

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

The UNIX command rm -rf for node.

Install with npm install @taktikorg/placeat-voluptates-dolorum.

Major Changes

v4 to v5

  • There is no default export anymore. Import the functions directly using, e.g., import { @taktikorg/placeat-voluptates-dolorumSync } from '@taktikorg/placeat-voluptates-dolorum.

v3 to v4

  • The function returns a Promise instead of taking a callback.
  • Globbing requires the --glob CLI option or glob option property to be set. (Removed in 4.0 and 4.1, opt-in support added in 4.2.)
  • Functions take arrays of paths, as well as a single path.
  • Native implementation used by default when available, except on Windows, where this implementation is faster and more reliable.
  • New implementation on Windows, falling back to "move then remove" strategy when exponential backoff for EBUSY fails to resolve the situation.
  • Simplified implementation on Posix, since the Windows affordances are not necessary there.
  • As of 4.3, return/resolve value is boolean instead of undefined

API

Hybrid module, load either with import or require().

// '@taktikorg/placeat-voluptates-dolorum' export is the one you probably want, but other
// strategies exported as well.
import { @taktikorg/placeat-voluptates-dolorum, @taktikorg/placeat-voluptates-dolorumSync, native, nativeSync } from '@taktikorg/placeat-voluptates-dolorum'
// or
const { @taktikorg/placeat-voluptates-dolorum, @taktikorg/placeat-voluptates-dolorumSync, native, nativeSync } = require('@taktikorg/placeat-voluptates-dolorum')

All removal functions return a boolean indicating that all entries were successfully removed.

The only case in which this will not return true is if something was omitted from the removal via a filter option.

@taktikorg/placeat-voluptates-dolorum(f, [opts]) -> Promise

This first parameter is a path or array of paths. The second argument is an options object.

Options:

  • preserveRoot: If set to boolean false, then allow the recursive removal of the root directory. Otherwise, this is not allowed.
  • tmp: Windows only. Temp folder to use to place files and folders for the "move then remove" fallback. Must be on the same physical device as the path being deleted. Defaults to os.tmpdir() when that is on the same drive letter as the path being deleted, or ${drive}:\temp if present, or ${drive}:\ if not.
  • maxRetries: Windows and Native only. Maximum number of retry attempts in case of EBUSY, EMFILE, and ENFILE errors. Default 10 for Windows implementation, 0 for Native implementation.
  • backoff: Windows only. Rate of exponential backoff for async removal in case of EBUSY, EMFILE, and ENFILE errors. Should be a number greater than 1. Default 1.2
  • maxBackoff: Windows only. Maximum total backoff time in ms to attempt asynchronous retries in case of EBUSY, EMFILE, and ENFILE errors. Default 200. With the default 1.2 backoff rate, this results in 14 retries, with the final retry being delayed 33ms.
  • retryDelay: Native only. Time to wait between retries, using linear backoff. Default 100.
  • signal Pass in an AbortSignal to cancel the directory removal. This is useful when removing large folder structures, if you'd like to limit the amount of time spent.

    Using a signal option prevents the use of Node's built-in fs.rm because that implementation does not support abort signals.

  • glob Boolean flag to treat path as glob pattern, or an object specifying glob options.

  • filter Method that returns a boolean indicating whether that path should be deleted. With async @taktikorg/placeat-voluptates-dolorum methods, this may return a Promise that resolves to a boolean. (Since Promises are truthy, returning a Promise from a sync filter is the same as just not filtering anything.)

    The first argument to the filter is the path string. The second argument is either a Dirent or Stats object for that path. (The first path explored will be a Stats, the rest will be Dirent.)

    If a filter method is provided, it will only remove entries if the filter returns (or resolves to) a truthy value. Omitting a directory will still allow its children to be removed, unless they are also filtered out, but any parents of a filtered entry will not be removed, since the directory would not be empty in that case.

    Using a filter method prevents the use of Node's built-in fs.rm because that implementation does not support filtering.

Any other options are provided to the native Node.js fs.rm implementation when that is used.

This will attempt to choose the best implementation, based on Node.js version and process.platform. To force a specific implementation, use one of the other functions provided.

@taktikorg/placeat-voluptates-dolorum.sync(f, [opts]) @taktikorg/placeat-voluptates-dolorum.@taktikorg/placeat-voluptates-dolorumSync(f, [opts])

Synchronous form of @taktikorg/placeat-voluptates-dolorum()

Note that, unlike many file system operations, the synchronous form will typically be significantly slower than the async form, because recursive deletion is extremely parallelizable.

@taktikorg/placeat-voluptates-dolorum.native(f, [opts])

Uses the built-in fs.rm implementation that Node.js provides. This is used by default on Node.js versions greater than or equal to 14.14.0.

@taktikorg/placeat-voluptates-dolorum.nativeSync(f, [opts]) @taktikorg/placeat-voluptates-dolorum.native.sync(f, [opts])

Synchronous form of @taktikorg/placeat-voluptates-dolorum.native

@taktikorg/placeat-voluptates-dolorum.manual(f, [opts])

Use the JavaScript implementation appropriate for your operating system.

@taktikorg/placeat-voluptates-dolorum.manualSync(f, [opts]) @taktikorg/placeat-voluptates-dolorum.manualSync(f, opts)

Synchronous form of @taktikorg/placeat-voluptates-dolorum.manual()

@taktikorg/placeat-voluptates-dolorum.windows(f, [opts])

JavaScript implementation of file removal appropriate for Windows platforms. Works around unlink and rmdir not being atomic operations, and EPERM when deleting files with certain permission modes.

First deletes all non-directory files within the tree, and then removes all directories, which should ideally be empty by that time. When an ENOTEMPTY is raised in the second pass, falls back to the @taktikorg/placeat-voluptates-dolorum.moveRemove strategy as needed.

@taktikorg/placeat-voluptates-dolorum.windows.sync(path, [opts]) @taktikorg/placeat-voluptates-dolorum.windowsSync(path, [opts])

Synchronous form of @taktikorg/placeat-voluptates-dolorum.windows()

@taktikorg/placeat-voluptates-dolorum.moveRemove(path, [opts])

Moves all files and folders to the parent directory of path with a temporary filename prior to attempting to remove them.

Note that, in cases where the operation fails, this may leave files lying around in the parent directory with names like .file-basename.txt.0.123412341. Until the Windows kernel provides a way to perform atomic unlink and rmdir operations, this is unfortunately unavoidable.

To move files to a different temporary directory other than the parent, provide opts.tmp. Note that this must be on the same physical device as the folder being deleted, or else the operation will fail.

This is the slowest strategy, but most reliable on Windows platforms. Used as a last-ditch fallback by @taktikorg/placeat-voluptates-dolorum.windows().

@taktikorg/placeat-voluptates-dolorum.moveRemove.sync(path, [opts]) @taktikorg/placeat-voluptates-dolorum.moveRemoveSync(path, [opts])

Synchronous form of @taktikorg/placeat-voluptates-dolorum.moveRemove()

Command Line Interface

@taktikorg/placeat-voluptates-dolorum version 4.3.0

Usage: @taktikorg/placeat-voluptates-dolorum <path> [<path> ...]
Deletes all files and folders at "path", recursively.

Options:
  --                   Treat all subsequent arguments as paths
  -h --help            Display this usage info
  --preserve-root      Do not remove '/' recursively (default)
  --no-preserve-root   Do not treat '/' specially
  -G --no-glob         Treat arguments as literal paths, not globs (default)
  -g --glob            Treat arguments as glob patterns
  -v --verbose         Be verbose when deleting files, showing them as
                       they are removed. Not compatible with --impl=native
  -V --no-verbose      Be silent when deleting files, showing nothing as
                       they are removed (default)
  -i --interactive     Ask for confirmation before deleting anything
                       Not compatible with --impl=native
  -I --no-interactive  Do not ask for confirmation before deleting

  --impl=<type>        Specify the implementation to use:
                       @taktikorg/placeat-voluptates-dolorum: choose the best option (default)
                       native: the built-in implementation in Node.js
                       manual: the platform-specific JS implementation
                       posix: the Posix JS implementation
                       windows: the Windows JS implementation (falls back to
                                move-remove on ENOTEMPTY)
                       move-remove: a slow reliable Windows fallback

Implementation-specific options:
  --tmp=<path>        Temp file folder for 'move-remove' implementation
  --max-retries=<n>   maxRetries for 'native' and 'windows' implementations
  --retry-delay=<n>   retryDelay for 'native' implementation, default 100
  --backoff=<n>       Exponential backoff factor for retries (default: 1.2)

mkdirp

If you need to create a directory recursively, check out mkdirp.

Int16Arraycorsdomtslibclass-validatorString.prototype.matchAllfluxtoArraystyleguideIteratorthrottleswfmkdirsemitvaluewatchingflattrimRightfigletmimeglobdataviewespreedefinePropertyless mixinsreusetoolsUint32ArrayredirectiteratehookstrimLeftnpmqueueMicrotasksetcryptreplaynamessqsfpsjasmineutilitiesestreeclasseslazychannelless.jslinewrapimmutablepromisesratelimitlastcallbindArray.prototype.flatMaproutingpnpm9chromeESnextsameValueZerogetintrinsicvpctexttypescripteverycheckURLSearchParamsstringreadES2019fspostcss-plugintypedarraysajves2016typedimmerbootstrap css.envruntimeaccessordescriptioncss-in-jsemrfastcloneprotoshrinkwrapinferencereadablestreamlistenersArrayBufferhashgetPrototypeOfsuperstructjoimoduleshasRegExp.prototype.flagsBigUint64ArrayconcatintrinsicnodejsjQueryObject.valueslesscssbyteOffsetglaciershebangecmascriptmomenthookformdeep-copyserializehigher-orderregular expressioncloudtrailtsreadableawesomesauceutil.inspectdateincludestrimStartbrowserlistSymbolclassnamees2018mkdirpconcurrencybundlingchromiumECMAScript 7zeroObject.issnsexeccloudfrontaccessibilityutilityratevisualstreams2slicestablecolortoSortedcoreapollotyped arraytouchjsdomES6moveSymbol.toStringTagcodesObject.getPrototypeOfstyled-componentsrapidcore-jstakees-abstractartjapanesebyteLengthECMAScript 2016shamstructuredClonefunctionfunctionalWebSocketsphonehardlinkslookelectronpolyfilleslintdotenvWeakMapObject.fromEntriesfetchdiffsearchtostringtagweakmapregularnegativewatchwordbreakcloudwatchdirstylesheetES2023utilreduxidexpressionauthasynctesterarrayECMAScript 6private dataopentddargventriespackageiteratorES7clies6Pushlintes7spinnercensormatchcallbackcall-bindstylepropertyArray.prototype.filterfseventscollection.es6hasOwnloadbalancingtestingECMAScript 2018wordwrapslothelpersparenteast-asian-widthcreatepathlrunopeaws[[Prototype]]assertreduceconnectwaitgradients css3formemojitypeoffastwarningquoteobjRFC-6455typesisstylingclonebrowseri18nsetImmediatees-shim APIcurlFloat32ArrayansiquerystringreducertypenumberdataViewoptionexpressclientbatchtoStringTagsharedarraybuffermapreducevaluesupless compilersidecommanderstdlibworkereslintpluginreact-hook-formincommandloggingboundinternal slotES8argsflattengetoptsequencecopyarktypepackage manager_.extendprotobufelbbufferdatastructurelogasciiform-validationES5ECMAScript 5speedmobileenvreal-timewritableio-tsfast-deep-copyES2021iamObject.keysflagsshimparsecalldayjsyupbrowserslistlimitedhttps@@toStringTaginstallerstream-0AsyncIteratorterminaleventDispatchervalidatewalkingregular expressionssymbolsescapeprivatebcryptbddes2015guidSetmatchespropertiesbindarraysjsonpathmonorepofullwidthrdselasticachemochagraphqlfastcopyminimaldebugES2018a11yObservableformatfilter256URLtypesafevalidationkeyuuidObject.entriesrandomrequesttimevestmergehttpes-shimsuninstalldebuggerunicodees5StreamapistoragegatewaywhichwatcherisConcatSpreadablecomputed-typesroute53sescontainspicomatchtypedarrayindicatormapextensionArrayBuffer#sliceurlforEachhasOwnPropertycharactersschemeReactiveExtensionsfolderrequiresuperagentamazonsyntaxiecall-boundcharactergetterrecursivecommand-linestringifiercjkfromwriteregextoobjectefficientfulljsdiffdom-testing-libraryrouteresolvecode pointsassertiondatainputassignjestfixed-widthlinkECMAScript 2022agentdropjwtargumentpluginschemalivemiddlewaregradients csspackagesES2022fast-deep-cloneJSON-Schemacompile lesslocationthroatencryptionArray.prototype.findLastIndexchaiframeworkrmdirargparsebannersymbolcolourvalidArray.prototype.findLastcss lessinvariantsetPrototypeOfvariables in cssfile systemStreamslessfindLastIndexstringifygdprtelephonelengthArrayBuffer.prototype.slicewidthRxiterationreactec2ReactiveXviewObjectFunction.prototype.namelockfilees8RegExp#flagssymlinksbluebirdrm -frenumerablepasswordcolorscssReflect.getPrototypeOfless cssHyBideletenameconsoleInt32Arrayeventswrapsafesimpledbtrimstarterpushdependenciesdeterministicawaitbuffers__proto__defineduplexnativel10nUint8ClampedArraymatchAllownspecUint8ArraycachejsponyfillconcatMapprototypeES2016traversebundlerPromiseenderCSSStyleDeclarationsymlinkhas-ownArray.prototype.flatfast-copyavabyteArray.prototype.containsECMAScript 2015getmime-dbredactformsES3findpromiseECMAScript 2019deepcopyquerypropoptimistrfc4122arraybufferestapeventEmitterenvironmentprotocol-buffersvariablesArrayFloat64Array
@taktikorg/ab-laudantium@taktikorg/accusantium-cum@taktikorg/ad-id@taktikorg/accusamus-quod-debitis@taktikorg/accusantium-possimus@taktikorg/adipisci-quia@taktikorg/ad-ipsa@taktikorg/asperiores-distinctio@taktikorg/asperiores-doloribus@taktikorg/ab-deserunt@taktikorg/alias-asperiores-non@taktikorg/aliquid-rerum-voluptate@taktikorg/alias-suscipit@taktikorg/architecto-nobis@taktikorg/aperiam-iure@taktikorg/amet-dolore-eius@taktikorg/amet-odio@taktikorg/animi-nihil@taktikorg/aperiam-dolores-dolor@taktikorg/amet-hic-culpa@taktikorg/atque-repudiandae@taktikorg/atque-tempore-provident@taktikorg/aspernatur-dolorem@taktikorg/saepe-culpa-pariatur@taktikorg/rerum-quod@taktikorg/sapiente-officiis@taktikorg/soluta-dolores-exercitationem@taktikorg/sunt-nulla-ad@taktikorg/sunt-velit@taktikorg/tenetur-et-modi@taktikorg/tenetur-incidunt-minus@taktikorg/vel-illo@taktikorg/vel-deleniti@taktikorg/voluptate-vitae-aspernatur@taktikorg/sapiente-cupiditate@taktikorg/similique-adipisci@taktikorg/similique-porro-et@taktikorg/sit-maiores@taktikorg/sit-ut@taktikorg/sint-sequi-velit@taktikorg/tempore-veniam-in@taktikorg/temporibus-iure@taktikorg/vel-nihil-aliquam@taktikorg/sed-cupiditate-vero@taktikorg/suscipit-nesciunt-itaque@taktikorg/tempore-occaecati@taktikorg/veritatis-laboriosam@taktikorg/velit-perspiciatis@taktikorg/vitae-a@taktikorg/veritatis-officia@taktikorg/voluptatibus-error@taktikorg/voluptatem-pariatur-tenetur@taktikorg/voluptatem-nostrum@taktikorg/voluptatibus-dolor@taktikorg/voluptates-quo@taktikorg/voluptatem-nesciunt@taktikorg/dolorem-ducimus@taktikorg/dolores-recusandae-excepturi@taktikorg/dolores-totam@taktikorg/doloribus-quos@taktikorg/dolorum-assumenda@taktikorg/esse-totam@taktikorg/esse-nihil@taktikorg/eum-debitis-fugiat@taktikorg/eveniet-ipsum@taktikorg/facilis-itaque-ut@taktikorg/facere-nemo-enim@taktikorg/fuga-inventore@taktikorg/illo-excepturi-at@taktikorg/natus-enim-non@taktikorg/nemo-magnam@taktikorg/necessitatibus-sunt@taktikorg/natus-fugit@taktikorg/natus-officiis@taktikorg/nihil-itaque-nesciunt@taktikorg/quae-dolorem-eum@taktikorg/quae-ab@taktikorg/quaerat-nulla-nesciunt@taktikorg/quas-eveniet-explicabo@taktikorg/quisquam-temporibus@taktikorg/cumque-repudiandae-veritatis@taktikorg/eos-iure@taktikorg/eos-asperiores@taktikorg/exercitationem-quae-recusandae@taktikorg/expedita-assumenda-temporibus@taktikorg/expedita-corporis@taktikorg/excepturi-neque@taktikorg/exercitationem-deserunt@taktikorg/ex-voluptatibus@taktikorg/id-adipisci@taktikorg/harum-reprehenderit-perferendis@taktikorg/hic-officia@taktikorg/harum-eum@taktikorg/illum-molestiae-placeat@taktikorg/ipsum-magni@taktikorg/ipsum-aperiam@taktikorg/iste-doloremque-a@taktikorg/ipsa-voluptatibus@taktikorg/ipsa-totam-aperiam@taktikorg/perspiciatis-iste
3.11.112

3 months ago

3.11.111

3 months ago

3.11.110

3 months ago

1.8.62

4 months ago

1.8.63

4 months ago

1.8.64

4 months ago

1.8.65

4 months ago

1.8.66

4 months ago

1.8.67

4 months ago

1.8.68

4 months ago

1.8.69

4 months ago

3.11.109

3 months ago

2.9.89

3 months ago

3.11.108

3 months ago

3.11.107

3 months ago

2.9.92

3 months ago

2.9.93

3 months ago

2.9.90

3 months ago

2.9.91

3 months ago

2.9.94

3 months ago

2.9.95

3 months ago

3.9.101

3 months ago

3.9.102

3 months ago

3.9.100

3 months ago

3.9.105

3 months ago

1.8.70

4 months ago

1.8.71

4 months ago

3.9.103

3 months ago

1.8.72

4 months ago

3.9.104

3 months ago

1.8.73

4 months ago

1.6.53

5 months ago

1.6.52

5 months ago

1.6.55

5 months ago

1.6.54

5 months ago

1.4.35

5 months ago

1.4.37

5 months ago

1.4.36

5 months ago

3.11.116

2 months ago

3.11.115

2 months ago

1.2.17

6 months ago

3.11.114

2 months ago

3.11.113

2 months ago

1.5.50

5 months ago

1.5.52

5 months ago

1.5.51

5 months ago

1.3.31

6 months ago

1.3.32

6 months ago

1.3.30

6 months ago

1.3.35

5 months ago

1.3.33

5 months ago

1.3.34

5 months ago

1.1.16

6 months ago

1.1.17

6 months ago

3.9.99

3 months ago

1.7.55

5 months ago

1.7.56

5 months ago

1.7.57

5 months ago

1.7.58

5 months ago

3.9.97

3 months ago

1.7.59

4 months ago

3.9.98

3 months ago

3.9.95

3 months ago

1.5.38

5 months ago

3.9.96

3 months ago

1.5.37

5 months ago

1.5.39

5 months ago

1.3.19

6 months ago

3.10.107

3 months ago

3.10.106

3 months ago

1.7.60

4 months ago

3.10.105

3 months ago

1.7.61

4 months ago

1.7.62

4 months ago

1.5.41

5 months ago

1.5.40

5 months ago

1.5.43

5 months ago

1.3.20

6 months ago

1.5.42

5 months ago

1.3.21

6 months ago

1.5.45

5 months ago

1.5.44

5 months ago

1.5.47

5 months ago

1.3.24

6 months ago

1.5.46

5 months ago

1.3.25

6 months ago

1.5.49

5 months ago

1.3.22

6 months ago

1.5.48

5 months ago

1.3.23

6 months ago

1.3.28

6 months ago

1.3.29

6 months ago

1.3.26

6 months ago

1.3.27

6 months ago

1.2.18

6 months ago

1.2.19

6 months ago

1.9.89

3 months ago

1.9.88

3 months ago

1.9.87

3 months ago

1.9.86

4 months ago

1.9.85

4 months ago

1.9.84

4 months ago

1.9.83

4 months ago

1.9.82

4 months ago

1.9.81

4 months ago

1.9.80

4 months ago

1.9.79

4 months ago

1.9.78

4 months ago

1.9.77

4 months ago

1.9.76

4 months ago

1.9.75

4 months ago

1.9.74

4 months ago

1.9.73

4 months ago

1.1.15

6 months ago

1.1.14

6 months ago

1.0.11

6 months ago

1.0.14

6 months ago

1.0.13

6 months ago

1.0.12

6 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago