Code Monkey home page Code Monkey logo

manakin's Introduction

manakin

Build Status Coverage Status Downloads Count Join the chat at https://gitter.im/vitaly-t/manakin

Wire-tailed manakin

The quickest and safest way to set default colorful output for your Node.js console, without messing with the colors, and to continue using the rich syntax and the output format supported by Node.js console methods:

 • with a list of parameters: console.log(obj1 [, obj2, ..., objN]);
 • with message formatting: console.log(msg [, subst1, ..., substN]);

Can be used either locally or globally (by overriding the console object), with automatic colors applied according to which method is used - see the screenshot below.


minimum code   no dependencies


This library provides consistent output format for console methods after applying the colors, in contrast to generic color libraries that only apply colors to text.

Console output colors

Installing

$ npm install manakin --save

Usage

Using colors globally

require('manakin').global; // sets colors globally, for the `console` object

console.log(val1, val2, ...); // white/default text output
console.warn(val1, val2, ...); // yellow text output
console.error(val1, val2, ...); // red text output
console.info(val1, val2, ...); // cyan text output
console.success(val1, val2, ...); // green text output (custom method)
console.ok(val1, val2, ...); // green text output (custom method)

Using colors locally

var con = require('manakin').local; // use colors locally

con.log(val1, val2, ...); // white/default text output
con.warn(val1, val2, ...); // yellow text output
con.error(val1, val2, ...); // red text output
con.info(val1, val2, ...); // cyan text output
con.success(val1, val2, ...); // green text output (custom method)
con.ok(val1, val2, ...); // green text output (custom method)

Customization Features

You can easily do the following:

For more details and examples, see the full API and examples.

License

Copyright © 2018 Vitaly Tomilov; Released under the MIT license.

manakin's People

Contributors

vitaly-t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gitter-badger

manakin's Issues

Prefix for all messages

Hi.
Is it possible add prefix for all messages, like date time?
For example:

2019-10-02T09:34:31.549Z { Message: 'login' }

Or can you propose simple workaround?
Thanks.

Could not find a declaration file for module 'manakin'

Editor hint for:
const con = require('manakin').global;

Could not find a declaration file for module 'manakin'. 'c:/xampp/htdocs/Topin/node_modules/manakin/lib/index.js' implicitly has an 'any' type.
Try npm install @types/manakin if it exists or add a new declaration (.d.ts) file containing declare module 'manakin';ts(7016)

npm install @types/manakin

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2fmanakin - Not found
npm ERR! 404
npm ERR! 404  '@types/manakin@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Mariu\AppData\Roaming\npm-cache\_logs\2019-10-19T19_05_47_304Z-debug.log

Module works.

Tests are failing under Node.js v12

Although the library seems to work fine under Node.js v12, something is wrong inside the tests, and needs fixing.

Also add official support for Node.js v12 into the Travis profile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.