You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.9 KiB

4 years ago
  1. # console-browserify [![Build Status](https://travis-ci.org/browserify/console-browserify.png?branch=master)](https://travis-ci.org/browserify/console-browserify)
  2. Emulate console for all the browsers
  3. ## Install
  4. 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](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) also include the `console-browserify` module when you do `require('console')`.
  5. But if none of those apply, with npm do:
  6. ```
  7. npm install console-browserify
  8. ```
  9. ## Usage
  10. ```js
  11. var console = require("console")
  12. // Or when manually using console-browserify directly:
  13. // var console = require("console-browserify")
  14. console.log("hello world!")
  15. ```
  16. ## API
  17. See the [Node.js Console docs](https://nodejs.org/api/console.html). `console-browserify` does not support creating new `Console` instances and does not support the Inspector-only methods.
  18. ## Contributing
  19. 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.
  20. 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](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js.
  21. If there is a difference in behaviour between Node.js's `console` module and this module, please open an issue!
  22. ## Contributors
  23. - Raynos
  24. ## License
  25. [MIT](./LICENSE)