Socket
Socket
Sign inDemoInstall

console-browserify

Package Overview
Dependencies
0
Maintainers
41
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    console-browserify

Emulate console for all the browsers


Version published
Weekly downloads
8.5M
increased by2.66%
Maintainers
41
Install size
10.9 kB
Created
Weekly downloads
 

Package description

What is console-browserify?

The console-browserify npm package is a browser-compatible version of the Node.js 'console' module, providing a way to emulate console functions in a browser environment. This is particularly useful for developers who need to maintain consistency in logging mechanisms between server-side and client-side JavaScript.

What are console-browserify's main functionalities?

Logging

Outputs a message to the web console. This is useful for simple debugging or displaying information.

console.log('Hello, world!');

Error Reporting

Outputs an error message to the console. This is used for reporting errors in a manner that is visually distinct from regular log messages.

console.error('Error: Something went wrong!');

Information Display

Used for informational messages that might not require the immediate attention that errors do.

console.info('This is an info message');

Warning Messages

Used to display warning messages about potential issues in the browser console.

console.warn('Warning: Please check your entry.');

Debugging

Provides a way to output debugging information. This can be more detailed and specific than a general log.

console.debug('Debugging value:', value);

Other packages similar to console-browserify

Changelog

Source

1.2.0

  • Move to the browserify org.
  • Remove date-now dependency. (@jakepusateri in #10)
  • Fix memory leak in time/timeEnd. (@maxnordlund in #11)

Readme

Source

console-browserify Build Status

Emulate console for all the browsers

Install

You usually do not have to install console-browserify yourself! If your code runs in Node.js, console is built in. If your code runs in the browser, bundlers like browserify or webpack also include the console-browserify module when you do require('console').

But if none of those apply, with npm do:

npm install console-browserify

Usage

var console = require("console")
// Or when manually using console-browserify directly:
// var console = require("console-browserify")

console.log("hello world!")

API

See the Node.js Console docs. console-browserify does not support creating new Console instances and does not support the Inspector-only methods.

Contributing

PRs are very welcome! The main way to contribute to console-browserify is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js. This module intends to provide exactly the same API as Node.js, so features that are not available in the core console module will not be accepted. Feature requests should instead be directed at nodejs/node and will be added to this module once they are implemented in Node.js.

If there is a difference in behaviour between Node.js's console module and this module, please open an issue!

Contributors

  • Raynos

License

MIT

FAQs

Last updated on 28 Oct 2019

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