Yet another opinionated cleaning tool to reset a working directory by deleting files/ folders that are ignored by default via
.gitignore
.
# Install via NPM
$ npm install --save @messageflow/clean
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',
// ]
}();
// @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',
// ]
}();
.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*/,
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.
MIT License © Rong Sen Ng