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

debug-lite

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debug-lite

A very tiny Javascript debugging utility. It's a lite version of debug.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

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

Debug Lite

A very tiny Javascript debugging utility. It's inspired by debug but for only be used on browsers.

File size

packageminifiedgzipped
debug (browser)7.67KB3.05KB
debug-lite1.37KB661 bytes

Files was minified using https://closure-compiler.appspot.com/home .

Installation

$ npm install debug-lite

Usage

For browser globals:

  • Using debug-lite.umd.min.js file and use window.debugLite.createDebug function.

For bundlers like Webpack or Browserify:

  • Using as module import { createDebug } from 'debug-lite'

Example

// import { createDebug } from 'debug-lite';
const createDebug = require('debug-lite').createDebug;

const log = createDebug('App');
const logInit = createDebug('App:init');
const logBuild = createDebug('App:build');

function init() {
  logInit('Initializing...');
}

function build() {
  logBuild('Building...');
}

function main () {
  log('app.js file is loaded');

  init();
  build();
}

main();

Open console and try:

localStorage.DEBUG = '*';
location.reload();

Show all messages

You can found a complete example here.

License

MIT

Keywords

FAQs

Package last updated on 21 May 2018

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