Socket
Socket
Sign inDemoInstall

cd-messenger

Package Overview
Dependencies
12
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cd-messenger

console log logger gulp notification browser node message


Version published
Weekly downloads
88
increased by57.14%
Maintainers
2
Install size
0.986 MB
Created
Weekly downloads
 

Readme

Source

cd-messenger

Node and Browser Messages

Use same API across browser or node and cd-messenger will handle the rest for you!

View on npm

Install with npm

npm i -S cd-messenger

Install with yarn

yarn add cd-messenger

Add as script tag

<script src="lib/messenger.min.js"></script>

Usage

const msg = require('cd-messenger');

// You can use titleCase or lower case for msg methods
// assuming `name` variable has been set to value before calling below

let name = 'Mike Erickson';

=========================================================================================
msg.info    ('Loading...');
msg.log     (`name: ${name}`);  // default color White
msg.info    (`name: ${name}`);  // default color Cyan
msg.success (`name: ${name}`);  // default color Green
msg.warning (`name: ${name}`);  // default color Yellow
msg.error   (`name: ${name}`);  // default color Red
msg.note    (`name: ${name}`);  // default color Orange
msg.debug   (`name: ${name}`);  // default color white
msg.table   (array|object)      // uses console.table (browser) or nice cli table (node)

=========================================================================================
msg.line(...)
msg.line  // displays a colored line (you can define line character, color, and width)
msg.line    ('', 'magenta');    // displays a line with solid magenta (no char)
msg.line    ('•', 'green');     // displays a line with repeating '•' and green
msg.line    ('', 'yellow', 40); // display with repeating (40) box, yellow

=========================================================================================
msg.setOptions(options: object)     // customize default browser appearance
 option.logger (true|false:default) // try it out and see how it looks

License

Copyright © 2016-2017 Mike Erickson Released under the MIT license

Credits

cd-messenger written by Mike Erickson

E-Mail: codedungeon@gmail.com

Twitter: @codedungeon

Webiste: codedungeon.org


Keywords

FAQs

Last updated on 03 Jul 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc