@shigen/polyfill-symbol-dispose
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Polyfill for Symbol.dispose and Symbol.asyncDispose

NPM Version

This is a lightweight polyfill for the wellknown symbols dispose and asyncDispose as defined in the proposal for Explicit Resource Management. Both Babel and TypeScript support the using and await using Syntax but require the symbols to be defined to work. This polyfill will only create the symbols if they don't exist yet and should be imported before one of the symbols is used. Node.js implemented its own polyfill in versions 18.18 and 20.4 until official support lands in v8.

A complete polyfill of the proposal is available through the disposablestack package.

Package Sidebar

Install

npm i @shigen/polyfill-symbol-dispose

Weekly Downloads

42

Version

1.0.1

License

ISC

Unpacked Size

5.68 kB

Total Files

14

Last publish

Collaborators

  • tao-cumplido