Run tasks over a group of files with progress logs and spinner
It's a common requirement to run asynchronous tasks over group of files:
This package allows you to simply provide a glob pattern for the files and a callback for each file:
import { logger } from "file-loggers";
logger(
"src/**/*.ts",
async () => {
await sleep(1000);
return Math.random() > 0.5 ? "Passing checks ✓" : "Failing checks ✕";
},
{
trail: true,
count: true,
timer: true,
},
);
npm install file-loggers
Documentation and more detailed examples are hosted on Github Pages.
In the example above all the options are enabled:
trail
- Show the output from the previous files.count
- Show the index of the current file.timer
- Show the time spent on each file.They can be independently set to false.
To install dependencies:
yarn install
To run tests:
yarn test
To generate the documentation locally:
yarn docs
To run linters:
yarn lint
To run formatters:
yarn format
Please read this repository's Code of Conduct which outlines our collaboration standards and the Changelog for details on breaking changes that have been made.
This repository adheres to semantic versioning standards. For more information on semantic versioning visit SemVer.
Bump2version is used to version and tag changes. For example:
bump2version patch
Lots of love to the open source community!