premove is a lightweight, cross-platform utility for Node.js that recursively removes files and directories, functioning as a programmatic `rm -rf`. It offers both `Promise`-based asynchronous (`premove`) and synchronous (`premove/sync`) APIs. The current stable version is 4.0.0. Releases are generally infrequent but address breaking changes or add features, as seen with v3.0.0's migration to named exports and v4.0.0's consistent boolean return for non-existent paths. Key differentiators include its tiny footprint (208B-260B), explicit support for both async/await and synchronous operations, and a built-in CLI. It's an alternative to `fs.rm` (or `fs.rmdir` with `recursive` option), providing a simpler, focused API for recursive deletion with safeguards against deleting critical system paths.
npm install premoveVerified import paths — ran on the pinned version, not inferred.
Demonstrates asynchronous recursive deletion of files and directories using `premove`, including the `cwd` option, and shows the boolean return value for existing and non-existing paths. Also includes cleanup using the sync version.
Update your import/require statements: `import { premove } from 'premove'` or `const { premove } = require('premove')`.Ensure your async code correctly `await`s the result of `premove` and expects a `Promise<boolean>`.
Always specify target paths relative to a safe `cwd` or ensure they are within intended deletion scope. Do not attempt to use `premove` for deleting system-level directories like `/` directly.
Use `import { premove } from 'premove/sync'` or `const { premove } = require('premove/sync')` for synchronous usage.Change your import statement to `import { premove } from 'premove';` (ESM) or `const { premove } = require('premove');` (CommonJS).If you need `Promise`-based behavior, import `premove` from the main package (`'premove'`). If you intend synchronous behavior, simply use the boolean return value directly without `await` or `.then()`.
No dependency data recorded yet.