@types/log-process-errors
Advanced tools
| { | ||
| "name": "@types/log-process-errors", | ||
| "version": "6.3.1", | ||
| "description": "TypeScript definitions for log-process-errors", | ||
| "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/log-process-errors", | ||
| "version": "9.1.0", | ||
| "description": "Stub TypeScript definitions entry for log-process-errors, which provides its own types definitions", | ||
| "main": "", | ||
| "scripts": {}, | ||
| "license": "MIT", | ||
| "contributors": [ | ||
| { | ||
| "name": "Jørgen Vatle", | ||
| "url": "https://github.com/JorgenVatle", | ||
| "githubUsername": "JorgenVatle" | ||
| }, | ||
| { | ||
| "name": "BendingBender", | ||
| "url": "https://github.com/BendingBender", | ||
| "githubUsername": "BendingBender" | ||
| } | ||
| ], | ||
| "main": "", | ||
| "types": "index.d.ts", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
| "directory": "types/log-process-errors" | ||
| "dependencies": { | ||
| "log-process-errors": "*" | ||
| }, | ||
| "scripts": {}, | ||
| "dependencies": {}, | ||
| "typesPublisherContentHash": "f67e452c2ac1439e89a5ffb2bbc2e970880af24273bd24e018b2ccc2de7fbb13", | ||
| "typeScriptVersion": "3.6" | ||
| "deprecated": "This is a stub types definition. log-process-errors provides its own type definitions, so you do not need this installed." | ||
| } |
@@ -1,16 +0,3 @@ | ||
| # Installation | ||
| > `npm install --save @types/log-process-errors` | ||
| This is a stub types definition for @types/log-process-errors (https://git.io/fhSGY). | ||
| # Summary | ||
| This package contains type definitions for log-process-errors (https://github.com/ehmicky/log-process-errors). | ||
| # Details | ||
| Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/log-process-errors. | ||
| ### Additional Details | ||
| * Last updated: Thu, 08 Jul 2021 16:23:48 GMT | ||
| * Dependencies: none | ||
| * Global values: none | ||
| # Credits | ||
| These definitions were written by [Jørgen Vatle](https://github.com/JorgenVatle), and [BendingBender](https://github.com/BendingBender). | ||
| log-process-errors provides its own type definitions, so you don't need @types/log-process-errors installed! |
| // Type definitions for log-process-errors 6.3 | ||
| // Project: https://github.com/ehmicky/log-process-errors | ||
| // Definitions by: Jørgen Vatle <https://github.com/JorgenVatle> | ||
| // BendingBender <https://github.com/BendingBender> | ||
| // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
| declare namespace logProcessErrors { | ||
| /** | ||
| * Exception type. | ||
| */ | ||
| type ExceptionType = | ||
| | "uncaughtException" | ||
| | "unhandledRejection" | ||
| | "rejectionHandled" | ||
| | "multipleResolves" | ||
| | "warning"; | ||
| /** | ||
| * Log level | ||
| */ | ||
| type LogLevel = "debug" | "info" | "warn" | "error" | "silent" | "default"; | ||
| type LogLevelGetter = (error: EnhancedError) => LogLevel; | ||
| /** | ||
| * log-process-errors constructor options. | ||
| */ | ||
| interface Options { | ||
| /** | ||
| * Customizes how process errors are logged. | ||
| * | ||
| * By default process errors will be logged to the console using `console.error()`, `console.warn()`, etc. | ||
| * This behavior can be overridden with this option. | ||
| * | ||
| * If logging is asynchronous, the function should return a promise (or use `async`/`await`). This is not | ||
| * necessary if logging is using streams (like [`Winston`](https://github.com/winstonjs/winston)). | ||
| * | ||
| * @param error This error is generated based on the original process error but with an improved `name`, | ||
| * `message` and `stack`. However the original process error is still available as the third argument | ||
| * `originalError`. | ||
| * @param level The log level, see `level` option. | ||
| * @param originalError The original process error thrown by Node. | ||
| * | ||
| * @example | ||
| * import logProcessErrors = require('log-process-errors'); | ||
| * import winstonLogger = require('winston'); | ||
| * | ||
| * // Log process errors with `Winston` instead of the default: | ||
| * | ||
| * logProcessErrors({ | ||
| * log(error, level, originalError) { | ||
| * winstonLogger[level](error.stack); | ||
| * }, | ||
| * }); | ||
| */ | ||
| log?(error: EnhancedError, level: LogLevel, originalError: Error): Promise<any> | void; | ||
| /** | ||
| * Which log level to use for different exceptions. | ||
| * | ||
| * @default { warning: 'warn', multipleResolves: 'info', default: 'error' } | ||
| * | ||
| * @example | ||
| * import logProcessErrors = require('log-process-errors'); | ||
| * | ||
| * logProcessErrors({ | ||
| * level: { | ||
| * // Use `debug` log level for `multipleResolves` instead of `info` | ||
| * multipleResolves: 'debug', | ||
| * | ||
| * // Skip some logs based on a condition | ||
| * default(error) { | ||
| * return shouldSkip(error) ? 'silent' : 'default'; | ||
| * }, | ||
| * }, | ||
| * }); | ||
| */ | ||
| level?: { | ||
| [key in ExceptionType | "default"]?: LogLevel | LogLevelGetter; | ||
| } | undefined; | ||
| /** | ||
| * Which process errors should trigger `process.exit(1)`: | ||
| * | ||
| * - `['uncaughtException', 'unhandledRejection']` is Node.js default behavior | ||
| * since Node.js `15.0.0`. Before, only | ||
| * [`uncaughtException`](https://nodejs.org/api/process.html#process_warning_using_uncaughtexception_correctly) | ||
| * was enabled. | ||
| * - use `[]` to prevent any `process.exit(1)`. Recommended if your process is | ||
| * long-running and does not automatically restart on exit. | ||
| * | ||
| * `process.exit(1)` will only be fired after successfully logging the process | ||
| * error. | ||
| * | ||
| * @default ['uncaughtException', 'unhandledRejection'] for Node >= 15.0.0, ['uncaughtException'] otherwise. | ||
| * | ||
| * @example | ||
| * import logProcessErrors = require('log-process-errors'); | ||
| * | ||
| * logProcessErrors({ exitOn: ['uncaughtException', 'unhandledRejection'] }); | ||
| */ | ||
| exitOn?: ExceptionType[] | undefined; | ||
| /** | ||
| * When running tests, makes them fail if there are any process errors. | ||
| * | ||
| * @default undefined | ||
| * | ||
| * @example | ||
| * import logProcessErrors = require('log-process-errors'); | ||
| * // Should be initialized before requiring other dependencies | ||
| * logProcessErrors({ testing: 'ava' }); | ||
| * | ||
| * import test from 'ava'; | ||
| * | ||
| * // Tests will fail because a warning is triggered | ||
| * test('Example test', (t) => { | ||
| * process.emitWarning('Example warning'); | ||
| * t.pass(); | ||
| * }); | ||
| * | ||
| * @example | ||
| * // To ignore specific process errors, use the `level` option: | ||
| * | ||
| * import logProcessErrors = require('log-process-errors'); | ||
| * // Should be initialized before requiring other dependencies | ||
| * logProcessErrors({ testing: 'ava', level: { warning: 'silent' } }); | ||
| * | ||
| * import test from 'ava'; | ||
| * | ||
| * // Tests will not fail because warnings are `'silent'` | ||
| * test('Example test', (t) => { | ||
| * process.emitWarning('Example warning'); | ||
| * t.pass(); | ||
| * }); | ||
| */ | ||
| testing?: "ava" | "mocha" | "jasmine" | "tape" | "node-tap" | undefined; | ||
| /** | ||
| * Whether or not to colorize messages. | ||
| * | ||
| * @default true // if the output is a terminal. | ||
| * | ||
| * @example | ||
| * import logProcessErrors = require('log-process-errors'); | ||
| * | ||
| * logProcessErrors({ colors: false }); | ||
| */ | ||
| colors?: boolean | undefined; | ||
| } | ||
| interface EnhancedError extends Error { | ||
| /** | ||
| * Possible values: | ||
| * [`'UncaughtException'`](https://nodejs.org/api/process.html#process_event_uncaughtexception), | ||
| * [`'UnhandledRejection'`](https://nodejs.org/api/process.html#process_event_unhandledrejection), | ||
| * [`'RejectionHandled'`](https://nodejs.org/api/process.html#process_event_rejectionhandled), | ||
| * [`'MultipleResolves'`](https://nodejs.org/api/process.html#process_event_multipleresolves) | ||
| * or [`'Warning'`](https://nodejs.org/api/process.html#process_event_warning) | ||
| */ | ||
| name: "UncaughtException" | "UnhandledRejection" | "RejectionHandled" | "MultipleResolves" | "Warning"; | ||
| message: string; | ||
| /** | ||
| * @link https://github.com/ehmicky/log-process-errors/blob/main/docs/API.md#errorstack | ||
| */ | ||
| stack: string; | ||
| } | ||
| } | ||
| /** | ||
| * Initializes `log-process-errors`. | ||
| * | ||
| * @returns A function that can be fired to restore Node.js default behavior. | ||
| * | ||
| * @example | ||
| * import logProcessErrors = require('log-process-errors'); | ||
| * | ||
| * const restore = logProcessErrors(); | ||
| * restore(); | ||
| * | ||
| * @example | ||
| * // Full example | ||
| * | ||
| * import logProcessErrors = require('log-process-errors'); | ||
| * import winstonLogger = require('winston'); | ||
| * | ||
| * logProcessErrors({ | ||
| * log(error, level) { | ||
| * winstonLogger[level](error.stack); | ||
| * }, | ||
| * level: { multipleResolves: 'debug' }, | ||
| * exitOn: ['uncaughtException', 'unhandledRejection'], | ||
| * testing: 'ava', | ||
| * colors: false, | ||
| * }); | ||
| */ | ||
| declare function logProcessErrors(options?: logProcessErrors.Options): () => void; | ||
| export = logProcessErrors; |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
1787
-82.2%1
Infinity%3
-25%0
-100%2
100%1
Infinity%2
100%3
-82.35%1
Infinity%2
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added