{"id":27535672,"url":"https://github.com/es-shims/disposablestack","last_synced_at":"2025-04-18T19:10:08.689Z","repository":{"id":65954097,"uuid":"580544974","full_name":"es-shims/DisposableStack","owner":"es-shims","description":"An ESnext spec-compliant `DisposableStack`, `AsyncDisposableStack`, `Symbol.dispose`, and `Symbol.asyncDispose` shim/polyfill/replacement that works as far down as ES3.","archived":false,"fork":false,"pushed_at":"2025-02-26T00:08:35.000Z","size":179,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T18:51:01.979Z","etag":null,"topics":["disposablestack","dispose","ecmascript","javascript","management","polyfill","resource","shim","using"],"latest_commit_sha":null,"homepage":"https://tc39.es/proposal-explicit-resource-management/#sec-disposablestack-constructor","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/es-shims.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"npm/es5-shim","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2022-12-20T20:34:56.000Z","updated_at":"2025-03-13T08:42:23.000Z","dependencies_parsed_at":"2024-02-14T03:22:47.481Z","dependency_job_id":"3cd7bc2c-2d0b-4444-9c40-e96f04310728","html_url":"https://github.com/es-shims/DisposableStack","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"f7c572c7604efe5d64a248ef8142a7ca6ea5570e"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FDisposableStack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FDisposableStack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FDisposableStack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FDisposableStack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/es-shims","download_url":"https://codeload.github.com/es-shims/DisposableStack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249535844,"owners_count":21287496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["disposablestack","dispose","ecmascript","javascript","management","polyfill","resource","shim","using"],"created_at":"2025-04-18T19:10:08.103Z","updated_at":"2025-04-18T19:10:08.679Z","avatar_url":"https://github.com/es-shims.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ljharb","https://tidelift.com/funding/github/npm/es5-shim"],"categories":[],"sub_categories":[],"readme":"# disposablestack \u003csup\u003e[![Version Badge][npm-version-svg]][package-url]\u003c/sup\u003e\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nAn ESnext spec-compliant `DisposableStack`, `AsyncDisposableStack`, `Symbol.dispose`, and `Symbol.asyncDispose` shim/polyfill/replacement that works as far down as ES3.\n\nIts root `auto` entrypoint also provides `SuppressedError`, via the [`suppressed-error`](https://npmjs.com/suppressed-error) package.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) “multi” interface. It works in an ES3-supported environment and complies with the proposed [spec](https://tc39.es/proposal-explicit-resource-management/).\n\n## Getting started\n\n```sh\nnpm install --save disposablestack\n```\n\n## Usage/Examples\n\n```js\nconst assert = require('assert');\n\nrequire('disposablestack/auto');\n\nassert.equal(typeof Symbol.dispose, 'symbol');\nassert.equal(typeof Symbol.asyncDispose, 'symbol');\n\nconst error = new SuppressedError();\nassert.ok(error instanceof Error);\n\nconst stack = new DisposableStack();\n\nconst asyncStack = new AsyncDisposableStack();\n\n// examples of stack methods\n\nstack.dispose();\n\nawait asyncStack.disposeAsync();\n\n// assert disposal was done\n```\n\n## Tests\n\nClone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/disposablestack\n[npm-version-svg]: https://versionbadg.es/es-shims/DisposableStack.svg\n[deps-svg]: https://david-dm.org/es-shims/DisposableStack.svg\n[deps-url]: https://david-dm.org/es-shims/DisposableStack\n[dev-deps-svg]: https://david-dm.org/es-shims/DisposableStack/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/DisposableStack#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/disposablestack.png?downloads=true\u0026stars=true\n[license-image]: https://img.shields.io/npm/l/disposablestack.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/disposablestack.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=disposablestack\n[codecov-image]: https://codecov.io/gh/es-shims/DisposableStack/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/DisposableStack/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/DisposableStack\n[actions-url]: https://github.com/es-shims/DisposableStack/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Fdisposablestack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fes-shims%2Fdisposablestack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Fdisposablestack/lists"}