{"id":15668886,"url":"https://github.com/jaydenseric/disposable-directory","last_synced_at":"2025-05-06T20:05:52.801Z","repository":{"id":57212975,"uuid":"230857541","full_name":"jaydenseric/disposable-directory","owner":"jaydenseric","description":"Asynchronously creates a disposable directory in the OS temporary directory that gets deleted after the callback is done or errors.","archived":false,"fork":false,"pushed_at":"2022-08-18T03:13:58.000Z","size":101,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T15:58:58.884Z","etag":null,"topics":["esm","maintained","mjs","node","npm","typescript"],"latest_commit_sha":null,"homepage":"https://npm.im/disposable-directory","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/jaydenseric.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/funding.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jaydenseric"}},"created_at":"2019-12-30T06:03:32.000Z","updated_at":"2022-08-18T03:37:30.000Z","dependencies_parsed_at":"2022-08-24T21:01:29.544Z","dependency_job_id":null,"html_url":"https://github.com/jaydenseric/disposable-directory","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fdisposable-directory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fdisposable-directory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fdisposable-directory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fdisposable-directory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaydenseric","download_url":"https://codeload.github.com/jaydenseric/disposable-directory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252761140,"owners_count":21800124,"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":["esm","maintained","mjs","node","npm","typescript"],"created_at":"2024-10-03T14:20:26.006Z","updated_at":"2025-05-06T20:05:52.775Z","avatar_url":"https://github.com/jaydenseric.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jaydenseric"],"categories":[],"sub_categories":[],"readme":"# disposable-directory\n\nAsynchronously creates a disposable directory in the OS temporary directory that gets deleted after the callback is done or errors.\n\n## Installation\n\nTo install [`disposable-directory`](https://npm.im/disposable-directory) with [npm](https://npmjs.com/get-npm), run:\n\n```sh\nnpm install disposable-directory\n```\n\nThen, import and use the function [`disposableDirectory`](./disposableDirectory.mjs).\n\n## Examples\n\nHow to use a disposable directory:\n\n```js\nimport disposableDirectory from \"disposable-directory\";\n\ndisposableDirectory(async (directoryPath) =\u003e {\n  // Use the directory here.\n})\n  .then(() =\u003e {\n    // The directory is gone.\n  })\n  .catch(() =\u003e {\n    // The directory is gone.\n  });\n```\n\n## Requirements\n\nSupported operating systems:\n\n- Linux\n- macOS\n\nSupported runtime environments:\n\n- [Node.js](https://nodejs.org) versions `^14.17.0 || ^16.0.0 || \u003e= 18.0.0`.\n\nProjects must configure [TypeScript](https://typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:\n\n- [`compilerOptions.allowJs`](https://typescriptlang.org/tsconfig#allowJs) should be `true`.\n- [`compilerOptions.maxNodeModuleJsDepth`](https://typescriptlang.org/tsconfig#maxNodeModuleJsDepth) should be reasonably large, e.g. `10`.\n- [`compilerOptions.module`](https://typescriptlang.org/tsconfig#module) should be `\"node16\"` or `\"nodenext\"`.\n\n## Exports\n\nThe [npm](https://npmjs.com) package [`disposable-directory`](https://npm.im/disposable-directory) features [optimal JavaScript module design](https://jaydenseric.com/blog/optimal-javascript-module-design). These ECMAScript modules are exported via the [`package.json`](./package.json) field [`exports`](https://nodejs.org/api/packages.html#exports):\n\n- [`disposableDirectory.mjs`](./disposableDirectory.mjs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fdisposable-directory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaydenseric%2Fdisposable-directory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fdisposable-directory/lists"}