https://github.com/lemarier/deno-env-paths
Get paths for storing things like data, config, cache, etc with Deno.
https://github.com/lemarier/deno-env-paths
deno environment-variables
Last synced: about 1 month ago
JSON representation
Get paths for storing things like data, config, cache, etc with Deno.
- Host: GitHub
- URL: https://github.com/lemarier/deno-env-paths
- Owner: lemarier
- Created: 2020-05-21T18:20:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-21T23:15:21.000Z (about 6 years ago)
- Last Synced: 2025-03-03T19:08:00.430Z (over 1 year ago)
- Topics: deno, environment-variables
- Language: TypeScript
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# env-paths
Get paths for storing things like data, config, cache, etc
[](https://github.com//lemarier/deno-env-paths/actions)
```ts
import envPaths from "https://deno.land/x/env_paths/mod.ts";
const paths = envPaths("MyApp");
console.log(paths.data);
//=> '/Users/david/Library/Application Support/MyApp-deno'
console.log(paths.config);
//=> '/Users/david/Library/Preferences/MyApp-deno'
```
## API
### paths = envPaths(name, options?)
Note: It only generates the path strings. It doesn't create the directories for you.
#### name
Type: `string`
Name of your project. Used to generate the paths.
#### options
Type: `object`
##### suffix
Type: `string`
Default: `'deno'`
**Don't use this option unless you really have to!**
Suffix appended to the project name to avoid name conflicts with native
apps.
### paths.data
Directory for data files.
### paths.config
Directory for config files.
### paths.cache
Directory for non-essential data files.
###
Directory for log files.
### paths.temp
Directory for temporary files.
---
Inspired by [env-paths](https://github.com/sindresorhus/env-paths) from [sindresorhus](https://github.com/sindresorhus).