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

console-line-logger

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

console-line-logger - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

13

index.js

@@ -9,3 +9,8 @@ "use strict";

const throwingLine = stackLines[2];
const matches = throwingLine.match(/[^\(]+\((.*\.js)\:(\d+)\:(\d+)\)/);
const matches = throwingLine.match(/[^\(\/]+\(?(.*\.js)\:(\d+)\:(\d+)\)?/);
if(! matches) {
return {
throwingLine: colors.blue(throwingLine.trim())
};
}
const fileName = path.relative(appRootDir, matches[1]);

@@ -20,4 +25,6 @@ const lineNumber = parseInt(matches[2], 10);

} catch(e) {
const { fileName, lineNumber } = extractFilenameAndLine(e);
console.log('\n' + colors.blue(fileName) + ':' + colors.red(lineNumber) + '\n', ...arguments);
const { fileName, lineNumber, throwingLine } = extractFilenameAndLine(e);
const str = throwingLine ? throwingLine :
colors.blue(fileName) + ':' + colors.red(lineNumber);
console.log('\n' + str + '\n', ...arguments);
}

@@ -24,0 +31,0 @@ }

{
"name": "console-line-logger",
"description": "console.log() that outputs file name and line number before args",
"version": "0.0.1",
"version": "0.0.2",
"author": {

@@ -6,0 +6,0 @@ "name": "Benoit Hubert",

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