@mstssk/cleandir
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

cleandir

Test npm version

cleandir just empty output directories.

  • Single purpose and feature.
    • Empty compiler's output directories.
    • Remain specified top directory.
      • .gitkeep and .keep is also remained.
  • Very tiny!
    • No dependencies.

Inspired by https://stackoverflow.com/a/57866165

Install

This package requires Node.js v12.12.0 or higher.

$ npm install --save-dev @mstssk/cleandir

Install from GitHub Package

You can install from GitHub Package. See a package page and GitHub Package document.

Usage

In npm-run-script:

// package.json
{
  "scripts": {
    "prebuild": "cleandir dist/",
    "build": "tsc"
  }
}

In your code:

const { cleandir } = require("@mstssk/cleandir");

(async function () {
  await cleandir(dirPaths);
})();

More complicated deleting?

I recommend to use rimraf, if you want conditional deleting.

Changelog

See https://github.com/mstssk/cleandir/releases

Readme

Keywords

Package Sidebar

Install

npm i @mstssk/cleandir

Weekly Downloads

13,429

Version

2.0.0

License

MIT

Unpacked Size

5.41 kB

Total Files

8

Last publish

Collaborators

  • mstssk