yadsil

0.1.1 • Public • Published

Yadsil

Yet another dead-simple log, on stderr, for CLI tools. Only when on a TTY, enable colors. Only when not on a TTY, prefix each output with the CLI tool name. Possibility to reactivate colors when not on a TTY (it's up to you to provide a --color option or something). That's all.

Install

$ npm install yadsil --save

Usage

log = require('yadsil')('my-tool-name');
// Enable verbose: just display `info` and `debug` messages.
log.verbose(true);
// Force colors (just needed when not in a TTY).
log.color(true);
// Exit after the message.
log.fatal(1, 'exit with %s', 'one');
// Basic messages.
log.error('foo');
log.warning('bar')
log.notice('baz');
log.info('dru');
log.debug('waf');

That's all.

Limitations

No log levels, no fancy features, not timestamps. Just the bare minimum on top of stderr, and will stay that way.

Contribute

Feel free to fork and submit pull requests.

/yadsil/

    Package Sidebar

    Install

    npm i yadsil

    Weekly Downloads

    74

    Version

    0.1.1

    License

    none

    Last publish

    Collaborators

    • undashes