Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justjavac/deno_config_dir
Returns the path to the user's config directory.
https://github.com/justjavac/deno_config_dir
deno deno-module deno-starter directory system
Last synced: 3 months ago
JSON representation
Returns the path to the user's config directory.
- Host: GitHub
- URL: https://github.com/justjavac/deno_config_dir
- Owner: justjavac
- License: mit
- Created: 2020-08-19T13:29:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T14:15:56.000Z (over 4 years ago)
- Last Synced: 2024-10-10T09:26:56.975Z (3 months ago)
- Topics: deno, deno-module, deno-starter, directory, system
- Language: TypeScript
- Homepage:
- Size: 4.88 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# deno_config_dir
[![tag](https://img.shields.io/github/release/justjavac/deno_config_dir)](https://github.com/justjavac/deno_config_dir/releases)
[![Build Status](https://github.com/justjavac/deno_config_dir/workflows/ci/badge.svg?branch=master)](https://github.com/justjavac/deno_config_dir/actions)
[![license](https://img.shields.io/github/license/justjavac/deno_config_dir)](https://github.com/justjavac/deno_config_dir/blob/master/LICENSE)
[![](https://img.shields.io/badge/deno-v1.3-green.svg)](https://github.com/denoland/deno)Returns the path to the user's config 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_CONFIG_HOME` or `$HOME`/.config | /home/justjavac/.config |
| macOS | `$HOME`/Library/Preferences | /Users/justjavac/Library/Preferences |
| Windows | `{FOLDERID_RoamingAppData}` | C:\Users\justjavac\AppData\Roaming |## Usage
Requires `allow-env` permission.
Returns `null` if there is no applicable directory or if any other error occurs.
```ts
import configDir from "https://deno.land/x/config_dir/mod.ts";configDir();
// Lin: "/home/justjavac/.config"
// Mac: "/Users/justjavac/Library/Preferences"
// Win: "C:\Users\justjavac\AppData\Roaming"
```## License
[deno_config_dir](https://github.com/justjavac/deno_config_dir) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.