npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xylabs/forget

v5.0.90

Published

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

Readme

@xylabs/forget

logo

main-build npm-badge npm-downloads-badge jsdelivr-badge npm-license-badge codacy-badge codeclimate-badge snyk-badge socket-badge

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

Reference

@xylabs/forget


Classes

| Class | Description | | ------ | ------ | | ForgetPromise | Node.js extension of ForgetPromise that can terminate the process on exceptions or timeouts. |

Interfaces

| Interface | Description | | ------ | ------ | | ForgetNodeConfig | Node.js-specific forget configuration that extends ForgetConfig with process termination options. |

Variables

| Variable | Description | | ------ | ------ | | defaultForgetNodeConfig | Default Node.js forget configuration with termination disabled. |

Functions

| Function | Description | | ------ | ------ | | forget | Node.js variant of forget that can optionally terminate the process on exceptions or timeouts. |

classes

ForgetPromise

@xylabs/forget


Node.js extension of ForgetPromise that can terminate the process on exceptions or timeouts.

Extends

  • ForgetPromise

Constructors

Constructor

new ForgetPromise(): ForgetPromiseNode;

Returns

ForgetPromiseNode

Inherited from

ForgetPromise.constructor

Properties

| Property | Modifier | Type | Default value | Description | Inherited from | | ------ | ------ | ------ | ------ | ------ | ------ | | activeForgets | static | number | 0 | Number of currently active (unresolved) forgotten promises. | ForgetPromise.activeForgets | | exceptedForgets | static | number | 0 | Number of forgotten promises that threw exceptions. | ForgetPromise.exceptedForgets | | logger | static | Logger | console | Logger instance used for error and warning output. | ForgetPromise.logger |

Accessors

active

Get Signature

get static active(): boolean;

Whether any forgotten promises are still active.

Returns

boolean

Inherited from

ForgetPromise.active

Methods

awaitInactive()

static awaitInactive(interval?: number, timeout?: number): Promise<number>;

Waits until all forgotten promises have completed.

Parameters

| Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | interval | number | 100 | Polling interval in milliseconds. | | timeout? | number | undefined | Optional maximum wait time in milliseconds. |

Returns

Promise<number>

The number of remaining active forgets (0 if all completed).

Inherited from

ForgetPromise.awaitInactive

exceptionHandler()

static exceptionHandler(
   error: Error, 
   config: ForgetNodeConfig, 
   externalStackTrace?: string): void;

Handles exceptions, optionally terminating the process based on config.

Parameters

| Parameter | Type | | ------ | ------ | | error | Error | | config | ForgetNodeConfig | | externalStackTrace? | string |

Returns

void

Overrides

ForgetPromise.exceptionHandler

forget()

static forget<T>(promise: Promisable<T>, config?: ForgetNodeConfig<T>): void;

Forgets a promise using Node.js-specific configuration with process termination support.

Type Parameters

| Type Parameter | | ------ | | T |

Parameters

| Parameter | Type | | ------ | ------ | | promise | Promisable<T> | | config? | ForgetNodeConfig<T> |

Returns

void

Overrides

ForgetPromise.forget

timeoutHandler()

static timeoutHandler(
   time: number, 
   config: ForgetNodeConfig, 
   externalStackTrace?: string): void;

Handles timeouts, optionally terminating the process based on config.

Parameters

| Parameter | Type | | ------ | ------ | | time | number | | config | ForgetNodeConfig | | externalStackTrace? | string |

Returns

void

Overrides

ForgetPromise.timeoutHandler

functions

forget

@xylabs/forget


function forget<T>(promise: Promisable<T>, config?: ForgetNodeConfig<T>): void;

Node.js variant of forget that can optionally terminate the process on exceptions or timeouts.

Type Parameters

| Type Parameter | | ------ | | T |

Parameters

| Parameter | Type | Description | | ------ | ------ | ------ | | promise | Promisable<T> | The promise or promisable value to forget. | | config? | ForgetNodeConfig<T> | Optional Node.js-specific configuration including process termination options. |

Returns

void

interfaces

ForgetNodeConfig

@xylabs/forget


Node.js-specific forget configuration that extends ForgetConfig with process termination options.

Extends

  • ForgetConfig<T>

Type Parameters

| Type Parameter | Default type | | ------ | ------ | | T | any |

Properties

| Property | Type | Description | Inherited from | | ------ | ------ | ------ | ------ | | name? | string | Optional name for identifying the forgotten promise in logs. | ForgetConfig.name | | onCancel? | () => void | Called when the promise is cancelled due to timeout. | ForgetConfig.onCancel | | onComplete? | (result: [T | undefined, Error | undefined]) => void | Called when the promise completes, with a tuple of [result, error]. | ForgetConfig.onComplete | | onException? | (error: Error) => void | Called when an exception occurs outside the promise itself. | ForgetConfig.onException | | timeout? | number | Timeout in milliseconds after which the promise is considered timed out. | ForgetConfig.timeout | | terminateOnException? | boolean | Terminate the process on an exception that happens outside of the promise being forgotten. | - | | terminateOnTimeout? | boolean | Terminate the process if the promise times out. | - |

variables

defaultForgetNodeConfig

@xylabs/forget


const defaultForgetNodeConfig: ForgetNodeConfig<unknown>;

Default Node.js forget configuration with termination disabled.

Part of sdk-js

Maintainers

License

See the LICENSE file for license details

Credits

Made with 🔥 and ❄️ by XYLabs