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

disposablestack

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

disposablestack

An ESnext spec-compliant `DisposableStack` and `Symbol.dispose` shim/polyfill/replacement that works as far down as ES3.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

disposablestack Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant DisposableStack and Symbol.dispose shim/polyfill/replacement that works as far down as ES3.

Its root auto entrypoint also provides SuppressedError, via the suppressed-error package.

In the future, this package will also provide AsyncDisposableStack and Symbol.asyncDispose, or whichever forms end up in stage 3.

This package implements the es-shim API “multi” interface. It works in an ES3-supported environment and complies with the proposed spec.

Getting started

npm install --save disposable-stack

Usage/Examples

const assert = require('assert');

require('disposable-stack/auto');

assert.equal(typeof Symbol.dispose, 'symbol');

const error = new SuppressedError();
assert.ok(error instanceof Error);

const stack = new DisposableStack();

// examples of stack methods

stack.dispose();

// assert disposal was done

Tests

Clone the repo, npm install, and run npm test

Keywords

FAQs

Package last updated on 18 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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