Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/njakob/cli-utils
Collection of utils to build CLI Node based applications
https://github.com/njakob/cli-utils
application cli color javascript logging nodejs reporter terminal
Last synced: 17 days ago
JSON representation
Collection of utils to build CLI Node based applications
- Host: GitHub
- URL: https://github.com/njakob/cli-utils
- Owner: njakob
- License: mit
- Created: 2017-04-15T17:08:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-20T14:40:32.000Z (over 7 years ago)
- Last Synced: 2024-12-16T18:29:33.996Z (17 days ago)
- Topics: application, cli, color, javascript, logging, nodejs, reporter, terminal
- Language: JavaScript
- Size: 50.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cli-utils [![NPM version][badge:npm-status]][npm:@njakob/cli-utils] [![Build Status][badge:build-status]][travis] [![ESLint Config][badge:eslint-config]][github:njakob/eslint-config] [![Conventional Commits][badge:conventional-commits]][conventional-commits]
> Collection of utils to build CLI Node based applications.
## Features
- Console reporter
## Installation
With NPM:
```
$ npm install @njakob/cli-utils
```With Yarn:
```
$ yarn add @njakob/cli-utils
```## Usage
### Console Reporter
```js
import { ConsoleReporter } from '@njakob/cli-utils';const reporter = new ConsoleReporter();
reporter.log(reporter.parse`Something to ${reporter.styles.red`log`}`, 2);
reporter.error(reporter.parse`${reporter.styles.red`Error`}: Something went wrong`);
reporter.success(reporter.parse`Something was a success`);
reporter.warning(reporter.parse`Something went not too good`);
reporter.failure(reporter.parse`Something went totally wrong`);
```## Related Projects
- [`rainbow`][github:njakob/rainbow]: String styling helpers inspired by Chalk.
## Inspired by
- `ConsoleReporter` system used in [`yarn`][github:yarnpkg/yarn]
## Changelog
See [changelog][CHANGELOG].
## Licences
`njakob/cli-utils` is licensed under the [MIT License][licence].
[changelog]: CHANGELOG.md
[licence]: LICENSE
[github:njakob/rainbow]: https://github.com/njakob/rainbow
[github:njakob/eslint-config]: https://github.com/njakob/eslint-config
[github:yarnpkg/yarn]: https://github.com/yarnpkg/yarn
[npm:@njakob/cli-utils]: https://nodei.co/npm/@njakob/cli-utils
[travis]: https://travis-ci.org/njakob/cli-utils
[conventional-commits]: https://conventionalcommits.org
[badge:npm-status]: https://img.shields.io/npm/v/@njakob/cli-utils.svg
[badge:build-status]: https://travis-ci.org/njakob/cli-utils.svg?branch=master
[badge:eslint-config]: https://img.shields.io/badge/eslint_config-njakob-463fd4.svg
[badge:conventional-commits]: https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg