diagnostic-channel

  • Version 1.0.0
  • Published
  • 17.6 kB
  • 1 dependency
  • MIT license

Install

npm i diagnostic-channel
yarn add diagnostic-channel
pnpm add diagnostic-channel

Overview

Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers

Index

Variables

variable channel

const channel: IChannel;

    Functions

    function makePatchingRequire

    makePatchingRequire: (
    knownPatches: IModulePatchMap
    ) => (moduleId: string) => any;

      Interfaces

      interface IChannel

      interface IChannel {}

        property spanContextPropagator

        spanContextPropagator: ScopeManager;

          method addContextPreservation

          addContextPreservation: <T extends Function>(preserver: (cb: T) => T) => void;

            method bindToContext

            bindToContext: <T extends Function>(cb: T) => T;

              method publish

              publish: <T>(name: string, event: T) => void;

                method registerMonkeyPatch

                registerMonkeyPatch: (packageName: string, patcher: IModulePatcher) => void;

                  method shouldPublish

                  shouldPublish: (name: string) => boolean;

                    method subscribe

                    subscribe: <T>(name: string, listener: ISubscriber<T>, filter?: IFilter) => void;

                      method unsubscribe

                      unsubscribe: <T>(
                      name: string,
                      listener: ISubscriber<T>,
                      filter?: IFilter
                      ) => void;

                        interface IModulePatcher

                        interface IModulePatcher {}

                          property patch

                          patch: PatchFunction;

                            property versionSpecifier

                            versionSpecifier: string;

                              interface ISpanContext

                              interface ISpanContext {}

                                property spanId

                                spanId: string;

                                  property traceFlags

                                  traceFlags?: string;

                                    property traceId

                                    traceId: string;

                                      property tracestate

                                      tracestate?: string;

                                        interface IStandardEvent

                                        interface IStandardEvent<T> {}

                                          property data

                                          data: T;

                                            property timestamp

                                            timestamp: number;

                                              Type Aliases

                                              type IFilter

                                              type IFilter = (publishing: boolean) => boolean;

                                                type ISubscriber

                                                type ISubscriber<T> = (event: IStandardEvent<T>) => void;

                                                  type PatchFunction

                                                  type PatchFunction = (module: any, path: string) => any;

                                                    Package Files (2)

                                                    Dependencies (1)

                                                    Dev Dependencies (6)

                                                    Peer Dependencies (0)

                                                    No peer dependencies.

                                                    Badge

                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/diagnostic-channel.

                                                    • Markdown
                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/diagnostic-channel)
                                                    • HTML
                                                      <a href="https://www.jsdocs.io/package/diagnostic-channel"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>