{"_id":"proxy-disposable","name":"proxy-disposable","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"proxy-disposable","version":"1.0.0","description":"Make objects with a dispose method compatible with an ES6 disposable","keywords":["disposable","dispose","monaco","monaco-editor","vscode"],"homepage":"https://github.com/remcohaszing/proxy-disposable#readme","bugs":{"url":"https://github.com/remcohaszing/proxy-disposable/issues"},"repository":{"type":"git","url":"git+https://github.com/remcohaszing/proxy-disposable.git"},"funding":"https://github.com/sponsors/remcohaszing","license":"MIT","author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"type":"module","exports":{"types":"./types/proxy-disposable.d.ts","default":"./lib/proxy-disposable.js"},"sideEffects":false,"scripts":{"prepack":"tsc --build","test":"c8 node --test"},"devDependencies":{"@remcohaszing/eslint":"^14.0.0","@types/node":"^25.0.0","c8":"^11.0.0","prettier":"^3.0.0","remark-cli":"^12.0.0","remark-preset-remcohaszing":"^3.0.0","typescript":"^6.0.0"},"_id":"proxy-disposable@1.0.0","_integrity":"sha512-Y673BKpFqk8XkYuoK9DGZ1RIzldz5SkzxTKc/+DkpaMdrDEbEalWlO/uMRMdJsXvdbTybJI26XDwN0KJpZDN4w==","_resolved":"/home/remco/Projects/proxy-disposable/proxy-disposable-1.0.0.tgz","_from":"file:proxy-disposable-1.0.0.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-Y673BKpFqk8XkYuoK9DGZ1RIzldz5SkzxTKc/+DkpaMdrDEbEalWlO/uMRMdJsXvdbTybJI26XDwN0KJpZDN4w==","shasum":"c61f2ebcf1215600088de75badf5882873c64382","tarball":"https://registry.npmjs.org/proxy-disposable/-/proxy-disposable-1.0.0.tgz","fileCount":6,"unpackedSize":7146,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGEDDthmjqGERBDe1X/DvbA7V2UkHKT3wPkwHS3owmT9AiBIR1lZ2bYlJ5YFROlvIGHGK4cq/siegzbDJBej7T3RWw=="}]},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"directories":{},"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/proxy-disposable_1.0.0_1779988923980_0.04374290200716313"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-28T17:22:03.911Z","1.0.0":"2026-05-28T17:22:04.165Z","modified":"2026-05-28T17:22:04.414Z"},"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"description":"Make objects with a dispose method compatible with an ES6 disposable","homepage":"https://github.com/remcohaszing/proxy-disposable#readme","keywords":["disposable","dispose","monaco","monaco-editor","vscode"],"repository":{"type":"git","url":"git+https://github.com/remcohaszing/proxy-disposable.git"},"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"bugs":{"url":"https://github.com/remcohaszing/proxy-disposable/issues"},"license":"MIT","readme":"# proxy-disposable\n\n[![github actions](https://github.com/remcohaszing/proxy-disposable/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/proxy-disposable/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/remcohaszing/proxy-disposable/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/proxy-disposable)\n[![npm version](https://img.shields.io/npm/v/proxy-disposable)](https://www.npmjs.com/package/proxy-disposable)\n[![npm downloads](https://img.shields.io/npm/dm/proxy-disposable)](https://www.npmjs.com/package/proxy-disposable)\n\nMake objects with a `dispose` method compatible with an ES6\n[disposable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/dispose).\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n  - [`d`](#d)\n- [Why](#why)\n- [Compatibility](#compatibility)\n- [License](#license)\n\n## Installation\n\n```sh\nnpm install proxy-disposable\n```\n\n## Usage\n\nCreate an object with a `dispose` method. Then wrap it using the [`d`](#d) function. For example,\nthe following script:\n\n```js\nimport { d } from 'proxy-disposable'\n\nusing disposable = d({\n  name: 'object',\n\n  dispose() {\n    console.log('Disposed', this.name)\n  }\n})\n\ndisposable.name = 'disposable'\n```\n\nYields:\n\n```plaintext\nDisposed disposable\n```\n\n## API\n\n### `d`\n\nWrap an object with a `dispose` method as an ES6\n[disposable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/dispose).\n\n#### Arguments\n\n- `disposable` (`Object`) — The disposable to wrap.\n\n#### Returns\n\nThe input disposable as an ES6 disposable.\n\n## Why\n\nThe `dispose` method is commonly used in various projects, such as\n[language server](https://github.com/microsoft/vscode-languageserver-node) related projects and\n[Monaco editor](https://microsoft.github.io/monaco-editor).\n\nThis package makes these nicer to work with in contexts where you want to quickly create an object,\nand clean up afterwards. A typical use case is tests.\n\n## Compatibility\n\nThis project is compatible with Node.js 22 or greater.\n\n## License\n\n[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)\n","readmeFilename":"README.md","_rev":"1-83281a60be32b72de6ef71431b593472"}