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

log-prefix

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

log-prefix

Prefix calls to console.log, console.warn, etc with whatever you'd like

  • 0.0.0
  • Source
  • npm
  • Socket score

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

log-prefix

Prefix calls to console.log, console.warn, etc with whatever you'd like

Example

console.log('before log-prefix');
require('log-prefix')('==> %s <==');
console.log('after log-prefix');

yields

before log-prefix
==> after log-prefix <==

You can specify a function instead of a string. The function must return a string to be used (good for dynamic values).

require('log-prefix')(function() { return '[' + Date.now() + '] %s' });
console.log('hello %s', 'world');

yields

[1371582989993] hello world

Install

npm install log-prefix

Tests

npm test

License

MIT License

Keywords

FAQs

Package last updated on 18 Jun 2013

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