
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
log-timestamp-moment
Advanced tools
Prepend timestamps to functions like console.log, console.warn, etc
Prepend timestamps to functions like console.log, console.warn, etc
console.log('Before log-timestamp');
require('log-timestamp');
console.log('After log-timestamp');
yields
Before log-timestamp
[2012-08-23T20:08:32.000Z] After log-timestamp
You can specify a custom function as well
require('log-timestamp')(function() { return 'date="' + new Date().toISOString() + '" message="%s"' });
console.log('hello %s', 'world');
yields
date="2012-08-23T20:08:37.000Z" message="hello world"
Also you can specify a custom prefix string
require('log-timestamp')('#WHATEVER');
console.log('hello world');
yields
#WHATEVER [2012-08-23T20:08:37.000Z] hello world
npm install log-timestamp
npm test
MIT License
FAQs
Prepend timestamps to functions like console.log, console.warn, etc
We found that log-timestamp-moment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.