@messageflow/clean
Quick clean with del
Yet another opinionated cleaning tool to reset a working directory by deleting files/ folders that are ignored by default via
.gitignore
.
Table of contents
Pre-requisites
Setup
Install
# Install via NPM
$ npm install --save @messageflow/clean
Usage
Node.js
const {
clean,
// IGNORE_PATH,
} = require('@messageflow/clean');
void async function main() {
const d = await clean();
console.log(d);
// The output might vary as it depends on the files/ folders that have been actually deleted from your system.
// [
// 'coverage',
// 'dist',
// 'index.d.ts',
// 'index.js',
// 'json.d.ts',
// 'node_modules',
// 'test',
// ]
}();
Native ES modules or TypeScript
// @ts-check
import {
clean,
// IGNORE_PATH,
} from '@messageflow/clean';
void async function main() {
const d = await clean();
console.log(d);
// The output might vary as it depends on the files/ folders that have been actually deleted from your system.
// [
// 'coverage',
// 'dist',
// 'index.d.ts',
// 'index.js',
// 'json.d.ts',
// 'node_modules',
// 'test',
// ]
}();
API Reference
IGNORE_PATH
.build/,
.DS_Store,
.esm-cache,
.nyc_output,
.tmp/,
.vscode,
npm-debug.log*,
yarn-error.log*,
coverage*/,
dist*/,
node_modules/,
test*/,
**/*.d.ts*,
**/*.js,
**/*.jsx,
!gulpfile*.js,
!src/demo/*.*,
!src/json.d.ts,
!src/test*/,
clean([options])
options
<Object> Optional configuration to delete files/ folders.gitConfig
<string> Optional path to.gitignore
. Defaults to./.gitignore
.path
<string|string[]> Optional glob pattern(s) to delete files/ folders. Defaults to IGNORE_PATH.options
<Object> Optional configuration from the NPM package del. See del options.
- returns: <Promise<string[]>> Promise which resolves with a list of deleted files/ folders.
License
MIT License © Rong Sen Ng