Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justjavac/deno_document_dir
Returns the path to the user's document directory.
https://github.com/justjavac/deno_document_dir
deno deno-module deno-starter dir document path
Last synced: about 1 month ago
JSON representation
Returns the path to the user's document directory.
- Host: GitHub
- URL: https://github.com/justjavac/deno_document_dir
- Owner: justjavac
- License: mit
- Created: 2020-08-19T14:40:47.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-04T08:47:07.000Z (about 2 years ago)
- Last Synced: 2024-04-13T09:06:22.173Z (7 months ago)
- Topics: deno, deno-module, deno-starter, dir, document, path
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# deno_document_dir
Returns the path to the user's document 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 | `XDG_DOCUMENTS_DIR` | /home/justjavac/Documents |
| macOS | `$HOME`/Documents | /Users/justjavac/Documents |
| Windows | `$USERPROFILE`/Documents | C:\Users\justjavac\Documents |## Usage
Requires `allow-env` permission.
Returns `null` if there is no applicable directory or if any other error occurs.
```ts
import documentDir from "https://deno.land/x/document_dir/mod.ts";documentDir();
// Lin: "/home/justjavac/Documents"
// Mac: "/Users/justjavac/Documents"
// Win: "C:\Users\justjavac\Documents"
```## License
[deno_document_dir](https://github.com/justjavac/deno_document_dir) is released
under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.