Skip to content

Repository files navigation

@messageflow/clean

Quick clean with del


NPM

VersionDownloadsMIT LicenseCode of Conduct

Build StatusDependency StatusNSP StatuscodecovCoverage Status

codebeat-badgecodacy-badge

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');voidasyncfunctionmain(){constd=awaitclean();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-checkimport{clean,// IGNORE_PATH,}from'@messageflow/clean';voidasyncfunctionmain(){constd=awaitclean();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.
  • returns: <Promise<string[]>> Promise which resolves with a list of deleted files/ folders.

License

MIT License © Rong Sen Ng

Releases

Packages

Used by

Contributors

Languages