Detalhes do pacote

remove-dir-safe

bconnorwhite1.1kMIT2.0.0

Remove directories recursively or non-recursively

remove, dir, directory, directories

readme (leia-me)

remove-dir-safe

NPM TypeScript Coverage Status GitHub Stars Twitter Follow


Remove directories recursively or non-recursively.

  • Returns true if directory no longer exists.
  • Returns false if unable to remove directory.
  • Returns undefined on other errors (ex: permission denied) rather than throwing.

Unless the unsafe flag is set, only directories inside the current working directory or OS temp directory will be removed.

Installation

yarn add remove-dir-safe
npm install remove-dir-safe

API

import { removeDir, removeDirSync, Options } from "write-dir-safe";

function removeDir(path: string, options: Options): Promise<boolean | undefined>;

function removeDirSync(path: string, options: Options): boolean | undefined;

type Options = {
  /**
   * If true, perform a recursive directory removal. Default: `true`
   */
  recursive?: boolean;
  /**
   * Allow removals outside of current working directory, or OS temp directory. Default: `false`
   */
  unsafe?: boolean;
}


Dependenciesdependencies


Dev DependenciesDavid


License license

MIT

changelog (log de mudanças)

2.0.0 (2021-06-08)

Features

BREAKING CHANGES

  • prevents removal of directories outside cwd or tmpdir without unsafe flag

1.0.1 (2020-10-04)

1.0.0 (2020-10-03)