Socket
Socket
Sign inDemoInstall

rimraf

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rimraf - npm Package Compare versions

Comparing version 4.4.1 to 5.0.1

24

dist/cjs/package.json
{
"name": "rimraf",
"version": "4.4.1",
"main": "./dist/cjs/src/index-cjs.js",
"version": "5.0.1",
"main": "./dist/cjs/src/index.js",
"module": "./dist/mjs/index.js",

@@ -16,3 +16,3 @@ "types": "./dist/mjs/index.d.ts",

"types": "./dist/cjs/src/index.d.ts",
"default": "./dist/cjs/src/index-cjs.js"
"default": "./dist/cjs/src/index.js"
}

@@ -59,3 +59,3 @@ }

"eslint-config-prettier": "^8.6.0",
"mkdirp": "1",
"mkdirp": "^3.0.0",
"prettier": "^2.8.2",

@@ -65,3 +65,3 @@ "tap": "^16.3.4",

"typedoc": "^0.23.21",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},

@@ -85,4 +85,14 @@ "tap": {

"dependencies": {
"glob": "^9.2.0"
}
"glob": "^10.2.5"
},
"keywords": [
"rm",
"rm -rf",
"rm -fr",
"remove",
"directory",
"cli",
"rmdir",
"recursive"
]
}
#!/usr/bin/env node
export declare const help: string;
declare const main: {
(...args: string[]): Promise<1 | 0>;
(...args: string[]): Promise<0 | 1>;
help: string;

@@ -6,0 +6,0 @@ };

#!/usr/bin/env node
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.help = void 0;
const package_json_1 = require("../package.json");
const index_cjs_js_1 = __importDefault(require("./index-cjs.js"));
const index_js_1 = require("./index.js");
const runHelpForUsage = () => console.error('run `rimraf --help` for usage information');

@@ -121,3 +118,3 @@ exports.help = `rimraf version ${package_json_1.version}

let dashdash = false;
let impl = index_cjs_js_1.default;
let impl = index_js_1.rimraf;
let interactive = false;

@@ -197,3 +194,3 @@ for (const arg of args) {

case 'rimraf':
impl = index_cjs_js_1.default;
impl = index_js_1.rimraf;
continue;

@@ -204,6 +201,6 @@ case 'native':

case 'windows':
impl = index_cjs_js_1.default[val];
impl = index_js_1.rimraf[val];
continue;
case 'move-remove':
impl = index_cjs_js_1.default.moveRemove;
impl = index_js_1.rimraf.moveRemove;
continue;

@@ -239,3 +236,3 @@ default:

}
if (impl === index_cjs_js_1.default.native && (interactive || opt.filter)) {
if (impl === index_js_1.rimraf.native && (interactive || opt.filter)) {
console.error('native implementation does not support -v or -i');

@@ -242,0 +239,0 @@ runHelpForUsage();

@@ -44,5 +44,3 @@ /// <reference types="node" />

export declare const rimraf: ((path: string | string[], opt?: RimrafAsyncOptions) => Promise<boolean>) & {
rimraf: ((path: string | string[], opt?: RimrafAsyncOptions) => Promise<boolean>) & {
sync: (path: string | string[], opt?: RimrafSyncOptions) => boolean;
};
rimraf: (path: string | string[], opt?: RimrafAsyncOptions) => Promise<boolean>;
sync: (path: string | string[], opt?: RimrafSyncOptions) => boolean;

@@ -71,3 +69,2 @@ rimrafSync: (path: string | string[], opt?: RimrafSyncOptions) => boolean;

};
export default rimraf;
//# sourceMappingURL=index.d.ts.map

@@ -74,5 +74,5 @@ "use strict";

exports.sync = exports.rimrafSync;
exports.rimraf = Object.assign(wrap((path, opt) => (0, use_native_js_1.useNative)(opt) ? (0, rimraf_native_js_1.rimrafNative)(path, opt) : (0, rimraf_manual_js_1.rimrafManual)(path, opt)), {
// this weirdness because it's easier than explicitly declaring
rimraf: exports.manual,
const rimraf_ = wrap((path, opt) => (0, use_native_js_1.useNative)(opt) ? (0, rimraf_native_js_1.rimrafNative)(path, opt) : (0, rimraf_manual_js_1.rimrafManual)(path, opt));
exports.rimraf = Object.assign(rimraf_, {
rimraf: rimraf_,
sync: exports.rimrafSync,

@@ -92,3 +92,2 @@ rimrafSync: exports.rimrafSync,

exports.rimraf.rimraf = exports.rimraf;
exports.default = exports.rimraf;
//# sourceMappingURL=index.js.map
/// <reference types="node" />
/// <reference types="node" />
export declare const readdirOrError: (path: string) => Promise<import("fs").Dirent[] | NodeJS.ErrnoException>;
export declare const readdirOrErrorSync: (path: string) => import("fs").Dirent[] | NodeJS.ErrnoException;
export declare const readdirOrError: (path: string) => Promise<NodeJS.ErrnoException | import("fs").Dirent[]>;
export declare const readdirOrErrorSync: (path: string) => NodeJS.ErrnoException | import("fs").Dirent[];
//# sourceMappingURL=readdir-or-error.d.ts.map

@@ -44,5 +44,3 @@ /// <reference types="node" />

export declare const rimraf: ((path: string | string[], opt?: RimrafAsyncOptions) => Promise<boolean>) & {
rimraf: ((path: string | string[], opt?: RimrafAsyncOptions) => Promise<boolean>) & {
sync: (path: string | string[], opt?: RimrafSyncOptions) => boolean;
};
rimraf: (path: string | string[], opt?: RimrafAsyncOptions) => Promise<boolean>;
sync: (path: string | string[], opt?: RimrafSyncOptions) => boolean;

@@ -71,3 +69,2 @@ rimrafSync: (path: string | string[], opt?: RimrafSyncOptions) => boolean;

};
export default rimraf;
//# sourceMappingURL=index.d.ts.map

@@ -66,5 +66,5 @@ import { optArg, optArgSync } from './opt-arg.js';

export const sync = rimrafSync;
export const rimraf = Object.assign(wrap((path, opt) => useNative(opt) ? rimrafNative(path, opt) : rimrafManual(path, opt)), {
// this weirdness because it's easier than explicitly declaring
rimraf: manual,
const rimraf_ = wrap((path, opt) => useNative(opt) ? rimrafNative(path, opt) : rimrafManual(path, opt));
export const rimraf = Object.assign(rimraf_, {
rimraf: rimraf_,
sync: rimrafSync,

@@ -84,3 +84,2 @@ rimrafSync: rimrafSync,

rimraf.rimraf = rimraf;
export default rimraf;
//# sourceMappingURL=index.js.map
{
"version": "4.4.0",
"version": "5.0.0",
"type": "module"
}
{
"name": "rimraf",
"version": "4.4.1",
"main": "./dist/cjs/src/index-cjs.js",
"version": "5.0.1",
"main": "./dist/cjs/src/index.js",
"module": "./dist/mjs/index.js",

@@ -16,3 +16,3 @@ "types": "./dist/mjs/index.d.ts",

"types": "./dist/cjs/src/index.d.ts",
"default": "./dist/cjs/src/index-cjs.js"
"default": "./dist/cjs/src/index.js"
}

@@ -59,3 +59,3 @@ }

"eslint-config-prettier": "^8.6.0",
"mkdirp": "1",
"mkdirp": "^3.0.0",
"prettier": "^2.8.2",

@@ -65,3 +65,3 @@ "tap": "^16.3.4",

"typedoc": "^0.23.21",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},

@@ -85,4 +85,14 @@ "tap": {

"dependencies": {
"glob": "^9.2.0"
}
"glob": "^10.2.5"
},
"keywords": [
"rm",
"rm -rf",
"rm -fr",
"remove",
"directory",
"cli",
"rmdir",
"recursive"
]
}

@@ -5,7 +5,14 @@ The [UNIX command](<http://en.wikipedia.org/wiki/Rm_(Unix)>) `rm -rf` for node.

## Major Changes from v3 to v4
## Major Changes
### v4 to v5
- There is no default export anymore. Import the functions directly
using, e.g., `import { rimrafSync } from 'rimraf`.
### v3 to v4
- The function returns a `Promise` instead of taking a callback.
- Globbing requires the `--glob` option to be set. (Removed in
4.0 and 4.1, opt-in support added in 4.2.)
- 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.

@@ -26,8 +33,4 @@ - Native implementation used by default when available, except on

```js
// default export is the main rimraf function, or use named imports
import rimraf from 'rimraf'
// or
const rimraf = require('rimraf')
// other strategies exported as well
// 'rimraf' export is the one you probably want, but other
// strategies exported as well.
import { rimraf, rimrafSync, native, nativeSync } from 'rimraf'

@@ -82,2 +85,4 @@ // or

- `glob` Boolean flag to treat path as glob pattern, or an object
specifying [`glob` options](https://github.com/isaacs/node-glob).
- `filter` Method that returns a boolean indicating whether that

@@ -84,0 +89,0 @@ path should be deleted. With async rimraf methods, this may

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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