{"_id":"using.js","_rev":"32-b3e967b5a39060d562d26f30e5896cae","time":{"1.0.0":"2016-04-04T17:18:06.227Z","created":"2019-09-19T19:26:30.101Z","1.1.0":"2019-09-19T19:26:30.196Z","modified":"2022-05-22T23:29:31.311Z","1.1.1":"2019-09-19T19:32:08.855Z","1.1.2":"2019-09-19T19:33:27.165Z"},"name":"using.js","dist-tags":{"latest":"1.1.2"},"versions":{"1.1.0":{"name":"using.js","version":"1.1.0","description":"Adds a 'using' statement to TypeScript or JavaScript","main":"dist/index.js","repository":{"type":"git","url":"git@gitlab.com:ahdavis/usingjs.git"},"author":{"name":"ahdavis","email":"ahdavis13@gmail.com"},"license":"MIT","private":false,"scripts":{"build":"rm -rf ./dist && tsc","doc":"rm -rf ./docs && typedoc src/","test":"jest"},"prepublish":"yarn build","keywords":["lifetime","using","resource-management"],"bugs":{"url":"https://gitlab.com/ahdavis/usingjs/issues"},"homepage":"https://gitlab.com/ahdavis/usingjs#readme","devDependencies":{"@types/jest":"^24.0.18","jest":"^24.9.0","ts-jest":"^24.1.0","typedoc":"^0.15.0"},"dependencies":{},"licenseText":"MIT License\n\nCopyright (c) 2019 Andrew Davis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"using.js@1.1.0","dist":{"shasum":"20bda7d896431b5111e2c9c87aed9c0dd199ba4e","integrity":"sha512-HzN2vgv6KIlDwjk23+9zXUCwjMFCzJ6ux2R2wQ3REAkjYHheTW562jqcAgUsraReLXcLJQ2aE8YasRwhS5A6IA==","tarball":"https://registry.npmjs.org/using.js/-/using.js-1.1.0.tgz","fileCount":17,"unpackedSize":8737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdg9ZmCRA9TVsSAnZWagAA6MYP/jf1Bph8hL4dhg4EFUOa\nrK7O+nocHiaXqIcSuHXd7lskWn7YggJZfw2qXojqSAdXWWnOQJxNzfg3Gpgf\nf+lvweN6CYmlhg9c7RKhxkOKb89R7TSE7z8oYuHaS61I3zHHI2lw3aVBTWkv\n9B/tlFKZBoxzB/sAczfp/vpU0bkPxMhkt5eRcUn8uAK1A87ZEY1en2NYQSiE\n+SwzPFbDhNgdoCOxFWcal3Bb2MtDudzHixLyfbQpmFQmmWFPCNjeJ2qcYBKm\nFvljLcR4QZpoAObmi1VxO3wWEa3AV3+ak6YFO/b6YA/6PZdjKdKKwB0J1Q6o\nhplVziHrITpAR1HrPGsUalHyEdJrJSyrzO1HiIJ/0OswcqP7qqeqn984jupZ\nDFB9dy95Zkkl/lD4e0qK07GG5bZorM1sTmuEkaBxoRfzFm4fWiaJj0EmKOyj\ncQr0DyLAr3TvxafvZYCh0KXJ9YMQAge4vCWWHQVSxSVMk0uWi62pEwqvfPlb\nbKlesdBWV0ojnboT7HaUO+5KrGlr38T8rYWeeXx4AG5eJKQcj0q7gBrn6ooh\nDXYNthnyrZCWKq3TKCR6ui1v6p7WYu8lrvxuVtCNwmV4Gw31z/0l33j618ff\n0cuC9lua+iXq43siv7w5ER2/1FWcR0o5keN5qNR+rfs2RAXjj/00gKMyVG7N\n47cf\r\n=s8dD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICU6uGWKYQ1bqh49MNrSZEklmPdHJksWHNA3iyxEPdYvAiBej0ndi9YIV5e7uCNYfzdnxcZFel/6JcF1UgVf43qCfA=="}]},"maintainers":[{"name":"ahdavis","email":"ahdavis13@gmail.com"}],"_npmUser":{"name":"ahdavis","email":"ahdavis13@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/using.js_1.1.0_1568921190101_0.4360192410851298"},"_hasShrinkwrap":false},"1.1.1":{"name":"using.js","version":"1.1.1","description":"Adds a 'using' statement to TypeScript or JavaScript","main":"dist/index.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"git@gitlab.com:ahdavis/usingjs.git"},"author":{"name":"ahdavis","email":"ahdavis13@gmail.com"},"license":"MIT","private":false,"scripts":{"build":"rm -rf ./dist && tsc","doc":"rm -rf ./docs && typedoc src/","test":"jest"},"prepublish":"yarn build","keywords":["lifetime","using","resource-management"],"bugs":{"url":"https://gitlab.com/ahdavis/usingjs/issues"},"homepage":"https://gitlab.com/ahdavis/usingjs#readme","devDependencies":{"@types/jest":"^24.0.18","jest":"^24.9.0","ts-jest":"^24.1.0","typedoc":"^0.15.0"},"dependencies":{},"licenseText":"MIT License\n\nCopyright (c) 2019 Andrew Davis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"using.js@1.1.1","dist":{"shasum":"884f7fa92fd853d9f4a947a8e178ce5f478c0390","integrity":"sha512-Rj+JcNiCw8tx92TsqDWyBdfacFbgc2FZK9yocrhxiQ6X8b6R1syYGZJw0k9vIfwh6dfx0g76g5DPMLtfYgSIRg==","tarball":"https://registry.npmjs.org/using.js/-/using.js-1.1.1.tgz","fileCount":17,"unpackedSize":8802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdg9e5CRA9TVsSAnZWagAAGloP/3RinOGMo8lLdmUyWP3l\nTivKJJNyk1nUtqDorYSgTjT2fy+6omzNl3cvOBMmJ/zrbDF60yxxb8ukbix7\n1hfTpJmUXoe7cd+2Evzi2JKHeAi0HUBdoXTeXMuPByaTvz58gdXjMrrljIwN\nAor6FjYCPbrzogEHGCFlI2D0zgDWrndMrSPNusHfRLyuPDel9lNlN0YzbPA5\nY10dd1+nPCFO3ay2rDJ0ZPLliA/T4G6/zpaTprKFHG9m4/lfOAvKmHdMDrSa\nm7sAgDNO8TK6os3knoPiPt3UUKCftXazOl6/o2ua+dvni8zyJz2YMctvEy+7\nnZ4UH+F4aDSEdBvcf+yhpxx20Jg04D1d6zvgb0iTMYVIrPAObcH1gJWI1Re+\n/4NdcmibQYW/SAr3+CFM6zkVoc+SY2sAs3so+BxDhxyiTHxuF7AaQQA+Ktyj\nU/+6QaZi3biVuV2qdudAgRnd9HCvf+If4lb3w+jY5/AehB2d6oW+knnV1lGL\nNO6H/GqSlF9OpNfEXKNrSwRVv6idFUUKtIbR+QYBxFzHj5wRQyANM83Pj4nl\nYVYQcAp3ctYf+ZuL0WA9DsZHgxATlKGSuUnBKeHdKBsRhOYDELtNU7ORoiM6\nR/en9KTA4i+/o+vafyDUlbqiYFVyvWoQUpqX8Oz0KDWv5S78uBIEzd1lB8aQ\n5yCN\r\n=adeL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHNnRpj6kPzoeBijCaCqqUq4zXgyAI/ejySdbd87eWVlAiEA3QrruyQi/lzEJB0kXhuVBQnw77SYLLYTXJgZhQ2LIY4="}]},"maintainers":[{"name":"ahdavis","email":"ahdavis13@gmail.com"}],"_npmUser":{"name":"ahdavis","email":"ahdavis13@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/using.js_1.1.1_1568921528716_0.11601498496609297"},"_hasShrinkwrap":false},"1.1.2":{"name":"using.js","version":"1.1.2","description":"Adds a 'using' statement to TypeScript or JavaScript","main":"dist/index.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"git@gitlab.com:ahdavis/usingjs.git"},"author":{"name":"ahdavis","email":"ahdavis13@gmail.com"},"license":"MIT","private":false,"scripts":{"build":"rm -rf ./dist && tsc","doc":"rm -rf ./docs && typedoc src/","test":"jest"},"prepublish":"yarn build","keywords":["lifetime","using","resource-management"],"bugs":{"url":"https://gitlab.com/ahdavis/usingjs/issues"},"homepage":"https://gitlab.com/ahdavis/usingjs#readme","devDependencies":{"@types/jest":"^24.0.18","jest":"^24.9.0","ts-jest":"^24.1.0","typedoc":"^0.15.0"},"dependencies":{},"licenseText":"MIT License\n\nCopyright (c) 2019 Andrew Davis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"using.js@1.1.2","dist":{"shasum":"f001ebc5192e55bd3d8bb9da35038b1f26e18ba4","integrity":"sha512-FdO+ufFzxZA6FwwxFpgQiZvMwxft/xi511joWh1YbOE0dPv9sL89wytCDxfj6uv+s1JAM6fzVS04TZ9IBF/mlw==","tarball":"https://registry.npmjs.org/using.js/-/using.js-1.1.2.tgz","fileCount":17,"unpackedSize":8867,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdg9gHCRA9TVsSAnZWagAAu8cP/juWzrvDMj5fUEh+uyAz\n2kZIM4lZBcLTCiRWItA2KXmvs8FiGuMPn1nKKBWmB4bKpWG9kbQiGuiLlKex\nYgV4o0p0ebP/mD/1H4y3fOmZG53zswrkyl5j8SCuaNJvZa+t5vRjqIL/xSof\nOq9m9s2j/zMunESo36j5wJPinO2AQZtoa9kq4U1DzWBOFySsaGAiWyR8bov/\nmAbyHEyOAv/LFpm9dwnTND9gFh+V86yBzMCixjBzgUfNFPD1Em/YU41uOPfz\nohOoUim1IYnvYioThzz9+JtK9/LEeEfT8OoTXj4I94TYSNN6kQrYBerQEY7C\nAiMRKqZ6DFLIqDazQIjOc7Xt3WManSpPbpaVg1lV+aKQ4G9/5yNqFoLYzbdG\nRhJaOdy+c/7uf/BAU/Z/G9De37DSd+EyElGYnNUUXbdRUri0qoi+r3Ax+Xqb\nvUBkgoEmXMmkRcrKkLQgDKhhKo0EAqoBSbKbUiA1ge5mfK8tTbkb4XGlwWpP\n7cuv8H4nZ5IveooLM9qk3GFyMLOOUXT5u/w8GPADiahYD2Vz3+MUSJLOcM1g\nOSU02yZNifSX2GFE91IGgglBqWnWM3zaibuUXcfK3BncRHbTmvxp6NOLqOpo\nayzGoz4kKnEvQ+RBgITCHS6tnIn3usvQNfVgwjOuHV87f8CyEww+pkMDUxFW\nTAMb\r\n=wexB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkPN1CbhqZ2C+I0QPWKHzQrlLxkVKRP2yqtVwotVzSXwIhAMP3QnKHNxkqxY/xjp9MswzBCf2KJGxIR5/oXxRfnN8d"}]},"maintainers":[{"name":"ahdavis","email":"ahdavis13@gmail.com"}],"_npmUser":{"name":"ahdavis","email":"ahdavis13@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/using.js_1.1.2_1568921606989_0.4528407194126318"},"_hasShrinkwrap":false}},"maintainers":[{"name":"ahdavis","email":"ahdavis13@gmail.com"}],"description":"Adds a 'using' statement to TypeScript or JavaScript","homepage":"https://gitlab.com/ahdavis/usingjs#readme","keywords":["lifetime","using","resource-management"],"repository":{"type":"git","url":"git@gitlab.com:ahdavis/usingjs.git"},"author":{"name":"ahdavis","email":"ahdavis13@gmail.com"},"bugs":{"url":"https://gitlab.com/ahdavis/usingjs/issues"},"license":"MIT","readme":"# using.js\n\nAdds a `using` statement to TS or JS\n\n\n# About\n\nThis package adds scoped object lifetimes to JavaScript or TypeScript.\nThis is achieved through a single function, `using`, that accepts an\nobject and a callback function that takes that object as an argument.\nAfter that callback function completely runs, regardless of errors thrown\nduring that time, the object will be disposed of. For this to happen,\nhowever, the object must contain a method called `dispose` that takes no\narguments and returns nothing. If you are using TypeScript, this is\nenforced by ensuring that the object passed to `using` implements\nthe `Disposable` interface exposed by this package. If you are using\nJavaScript, however, an error will be thrown if the object does not\ncontain a `dispose` method.\n\n# Installation\n\nTo install this package, type\n\n`npm install using` \n\nor\n\n`yarn add using`\n\nat the command line of your computer.\n\n# API\n\nThis package exposes three modules. They are:\n\n* `Disposable`, an interface that provides the mentioned `dispose` method\n* `using`, the function mentioned above\n* `UsingError`, an error that is thrown if an object is not `Disposable`.\n\nThe declarations of these modules are as follows:\n\n```typescript\ninterface Disposable {\n\tdispose(): void;\n}\n\nfunction using<T extends Disposable>(obj: T, func: (obj: T) => void);\n\nclass UsingError extends Error {\n\t//constructor omitted\n}\n\n```\n\n# License\n\nThis package is licensed under the MIT License. See the `LICENSE` file\nin its GitLab repository for more information.\n","readmeFilename":"README.md"}