New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

log-timestamp

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

log-timestamp - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

9

log-timestamp.js

@@ -9,4 +9,9 @@ var util = require('util');

function patch(fn) {
logprefix(fn || timestamp);
function patch(prefix) {
if(typeof prefix === 'function')
logprefix(prefix);
else if(typeof prefix === 'string' && prefix)
logprefix(() => prefix + ' ' + timestamp());
else
logprefix(timestamp);
}

@@ -13,0 +18,0 @@

{
"name": "log-timestamp",
"description": "Prepend timestamps to functions like console.log, console.warn, etc",
"version": "0.2.1",
"version": "0.3.0",
"author": "Dave Eddy <dave@daveeddy.com> (http://www.daveeddy.com)",

@@ -6,0 +6,0 @@ "contributors": [],

@@ -35,2 +35,16 @@ log-timestamp

Also you can specify a custom prefix string
``` js
require('log-timestamp')('#WHATEVER');
console.log('hello world');
```
yields
```
#WHATEVER [2012-08-23T20:08:37.000Z] hello world
```
Install

@@ -37,0 +51,0 @@ ------

@@ -7,5 +7,5 @@ #!/usr/bin/env node

['log', 'info', 'warn', 'error'].forEach(function(k) {
['debug', 'log', 'info', 'warn', 'error'].forEach(function(k) {
process.stdout.write('Testing ' + k + '\n');
console[k]('Hello %s!', 'world');
});

@@ -5,5 +5,5 @@ #!/usr/bin/env node

['log', 'info', 'warn', 'error'].forEach(function(k) {
['debug', 'log', 'info', 'warn', 'error'].forEach(function(k) {
process.stdout.write('Testing ' + k + '\n');
console[k]('Hello %s!', 'world');
});
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