https://github.com/justjavac/deno_audio_dir
Returns the path to the user's audio directory.
https://github.com/justjavac/deno_audio_dir
deno deno-module directory path system
Last synced: 2 months ago
JSON representation
Returns the path to the user's audio directory.
- Host: GitHub
- URL: https://github.com/justjavac/deno_audio_dir
- Owner: justjavac
- License: mit
- Created: 2020-08-19T14:21:20.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T14:29:06.000Z (almost 6 years ago)
- Last Synced: 2026-03-21T21:53:49.016Z (3 months ago)
- Topics: deno, deno-module, directory, path, system
- Language: TypeScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# deno_audio_dir
[](https://github.com/justjavac/deno_audio_dir/releases)
[](https://github.com/justjavac/deno_audio_dir/actions)
[](https://github.com/justjavac/deno_audio_dir/blob/master/LICENSE)
[](https://github.com/denoland/deno)
Returns the path to the user's audio 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_MUSIC_DIR` | /home/justjavac/Music |
| macOS | `$HOME`/Music | /Users/justjavac/Music |
| Windows | `{FOLDERID_Music}` | C:\Users\justjavac\Music |
## Usage
Requires `allow-env` permission.
Returns `null` if there is no applicable directory or if any other error occurs.
```ts
import audioDir from "https://deno.land/x/audio_dir/mod.ts";
audioDir();
// Lin: "/home/justjavac/Music"
// Mac: "/Users/justjavac/Music"
// Win: "C:\Users\justjavac\Music"
```
## License
[deno_audio_dir](https://github.com/justjavac/deno_audio_dir) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.