https://github.com/justjavac/deno_tmp_dir
Returns the path to the user's tmp directory.
https://github.com/justjavac/deno_tmp_dir
deno deno-mod deno-module deno-modules dir path tmp
Last synced: 4 months ago
JSON representation
Returns the path to the user's tmp directory.
- Host: GitHub
- URL: https://github.com/justjavac/deno_tmp_dir
- Owner: justjavac
- License: mit
- Created: 2020-08-19T15:18:30.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T15:29:11.000Z (almost 5 years ago)
- Last Synced: 2025-03-09T15:36:26.347Z (4 months ago)
- Topics: deno, deno-mod, deno-module, deno-modules, dir, path, tmp
- Language: TypeScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# deno_tmp_dir
[](https://github.com/justjavac/deno_tmp_dir/releases)
[](https://github.com/justjavac/deno_tmp_dir/actions)
[](https://github.com/justjavac/deno_tmp_dir/blob/master/LICENSE)
[](https://github.com/denoland/deno)Returns the path to the user's tmp directory.
The returned value depends on the operating system and is either a string,
containing a value from the following table, or `null`.|Platform | Value | Example |
| ------- | ---------------------- | ---------------------------------------------------------- |
| Linux | `TMPDIR` | /tmp |
| macOS | `TMPDIR` | /tmp |
| Windows | `{TMP}` | C:\Users\justjavac\AppData\Local\Temp |## Usage
Requires `allow-env` permission.
Returns `null` if there is no applicable directory or if any other error occurs.
```ts
import tmpDir from "https://deno.land/x/tmp_dir/mod.ts";tmpDir();
// Lin: "/tmp"
// Mac: "/tmp"
// Win: "C:\Users\justjavac\AppData\Local\Temp"
```## License
[deno_tmp_dir](https://github.com/justjavac/deno_tmp_dir) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.