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

0console

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

0console

Patched console functions with improved output.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

✒️ 0console

NPM version

Simple patched console functions with improved output.

Screenshot

📥 Install

npm i 0console

🏁 Use

With patched console object:

require("0console").patch();

console.log("Hello World!");
console.log("Highlighted", "Hello World!");

Without patching the console object:

const $console = require("0console");

$console.log("Hello World!");
$console.log("Highlighted", "Hello World!");

⚙️ Functions

  • console.log(...args) : Writes a normal message.
  • console.info(...args) : Writes an information message.
  • console.warn(...args) : Writes a warning message.
  • console.error(...args) : Writes an error message.
  • console.clear(...args) : Clears the output (Unlike the original).
  • 🆕 console.success(...args) : Writes a success message.
  • 🆕 console.line(char?, color?, count?) : Writes an horizontal line.
    • char : text to repeat (one character).
    • color : text color in the console (Using Chalk).
    • count : times to repeat char (Length of the line).

💡 If a logging function (log, info, warn, error, success) has more than one argument, the text of the first argument will be highlighted in the console.

⚙️ Craft Function

You can craft your own custom function:

const $console = require("0console");

const newConsoleInfo = $console.craft(console.info, {
  prefix: { text: "?", color: "cyanBright", bgColor: "bgBlueBright" },
  highlight: { color: "blueBright" },
  normal: { color: "blueBright" },
});
  • console.craft(fn, options?) : Crafts a patched version of the given console function.
    • fn : Console function to craft from.
    • options : Options object.
      • prefix : Object describing the prefix text.
        • text: Text of the prefix.
        • color: Color of the prefix.
        • bgColor: Background color of the prefix.
      • highlight : Object describing the highlighted text of the first argument.
        • color: Color of the highlighted text.
      • normal : Object describing the normal text.
        • color: Color of the normal text.

📃 License

MIT © Ambratolm

Keywords

FAQs

Package last updated on 06 Mar 2022

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