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

logginator

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logginator - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

32

index.js

@@ -0,1 +1,2 @@

var fs = require('fs');
var path = require('path');

@@ -7,9 +8,28 @@ var winston = require('winston');

function moduleName() {
if (module && module.parent && module.parent.id) {
var moduleFile = path.basename(module.parent.id);
var nameMatch = /(.*)\.js$/.exec(moduleFile);
if (nameMatch && nameMatch[1])
return nameMatch[1];
function moduleId() {
if (module && module.parent && module.parent.id) {
var id = module.parent.id;
var moduleFile = path.basename(id);
var nameMatch = /(.*)\.js$/.exec(moduleFile);
if (nameMatch && nameMatch[1])
return nameMatch[1];
}
}
return "main";
function packageDef() {
var ppath = path.dirname(module.parent.filename);
while (ppath) {
var packFile = path.join(ppath, "package.json");
if (fs.existsSync(packFile)) {
try {
var packageConfig = JSON.parse(fs.readFileSync(packFile));
return packageConfig.name;
} catch(_) { /* ignore */ }
}
ppath = path.dirname(ppath);
}
}
function filename() {
return path.basename(module.parent.filename);
}
return moduleId() || packageDef() || filename() || "main";
}

@@ -16,0 +36,0 @@

2

package.json
{
"name": "logginator",
"version": "1.1.1",
"version": "1.1.2",
"description": "Creates an instance of TaggedLogger",

@@ -5,0 +5,0 @@ "main": "index.js",

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