Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bows

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bows

Rainbowed console logs for chrome in development

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Colorize your logs (WIP)

  • Safely wraps console.log for development mode
  • Optional colorizing on a module by module basis
  • Colors are automatically assigned and updated, to be as far from each other as possible

Example output

Usage

  • Works great in browserify

Browserify

//In mymodule.js
var log = require('bows')('MyModule');
...

log(log.wrap('My log string')) //=> colorized "MyModule | My log string"


/In another module.js
var log = require('bows')('Another Module');

log(log.wrap('My log')) //=> colorized "Another Module | My log"

Example

var firstModule = (function() {
  var logwrap = bows('firstModule');

  return function() {
    var a = 1 + 1;
    bows.log(logwrap('The result is', a))
    return a
  }
})();

var anotherModule = (function() {
  var logwrap = bows('this is another module');

  return function() {
    var b = 1 + 1;
    bows.log(logwrap('The result is', b));
    return b;
  }
})();

var moreModule = (function() {
  var logwrap = bows('this is another module');

  return function(val) {
    bows.log(logwrap('I got a ', val));
  }
})();

firstModule();
anotherModule();
moreModule(5);

Result:

Example output

License

MIT

FAQs

Package last updated on 22 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc