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

@phenomnomnominal/debug

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phenomnomnominal/debug - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

11

dist/debugger.js

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

var module_1 = tslib_1.__importDefault(require("module"));
var path = tslib_1.__importStar(require("path"));
var perf_hooks_1 = require("perf_hooks");

@@ -21,5 +22,6 @@ var util_1 = require("util");

DebuggerΩ.prototype.shouldWrap = function (requirePath) {
var isNodeModule = module_1.default.builtinModules.includes(requirePath) || requirePath.includes('node_modules');
var isIncludedModule = this._include.some(function (regexp) { return regexp.test(requirePath); });
var isIgnoredModule = this._ignore.some(function (regexp) { return regexp.test(requirePath); });
var normalisedRequirePath = normalisePath(requirePath);
var isNodeModule = module_1.default.builtinModules.includes(normalisedRequirePath) || normalisedRequirePath.includes('node_modules');
var isIncludedModule = this._include.some(function (regexp) { return regexp.test(normalisedRequirePath); });
var isIgnoredModule = this._ignore.some(function (regexp) { return regexp.test(normalisedRequirePath); });
return !((isNodeModule && !isIncludedModule) || isIgnoredModule);

@@ -117,2 +119,5 @@ };

}
function normalisePath(filePath) {
return path.sep === path.posix.sep ? filePath : filePath.split(path.sep).join(path.posix.sep);
}
//# sourceMappingURL=debugger.js.map
{
"name": "@phenomnomnominal/debug",
"version": "0.1.0",
"version": "0.1.1",
"description": "Very lazy tool for adding debug logging",

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

@@ -5,2 +5,25 @@ # [@phenomnomnominal/debug](https://github.com/phenomnomnominal/debug/)

**`Debug`** is a super lazy way to add debug logging!
**`debug`** is a super lazy way to add debug logging!
## Usage
```typescript
import { debug } from '@phenomnomnominal/debug';
debug({ enabled: true });
```
## Options
```typescript
export type DebugOptions = {
enabled: boolean; // Enable debug logging
time: boolean; // Enable function execution time logging
values: boolean; // Enable argument and return value logging
logPath: string; // Disable stdout logging and print to file at this path
header: string; // Header name for the initial debug log
include: DebugIncludes; // RegExp to match node_modules paths that should be included in the logs
ignore: DebugIgnores; // RegExp to match local paths that should be ignored from the logs
logger: DebugLogger; // Custom logger implementation (Maybe you want to send it via HTTP 🤷‍♂️)
};
```

Sorry, the diff of this file is not supported yet

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