mstssk / cleandir

Cleanup directories for Node.js.

Home Page:https://www.npmjs.com/package/@mstssk/cleandir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

$ 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

About

Cleanup directories for Node.js.

https://www.npmjs.com/package/@mstssk/cleandir

License:MIT License


Languages

Language:JavaScript 62.8%Language:TypeScript 37.2%