file-loggers v0.2.0
File logger
Run tasks over a group of files with progress logs and spinner
Motivation
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,
},
);Installing
npm install file-loggersDocumentation
Documentation and more detailed examples are hosted on Github Pages.
Usage
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.
Tooling
Dependencies
To install dependencies:
yarn installTests
To run tests:
yarn testDocumentation
To generate the documentation locally:
yarn docsLinters
To run linters:
yarn lintFormatters
To run formatters:
yarn formatContributing
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 patchContributors
- Joel Lefkowitz - Initial work
Remarks
Lots of love to the open source community!
12 months ago