• Home
Name Date Size #Lines LOC

..--

index.d.tsD12-May-20241.4 KiB7017

index.jsD12-May-20242.1 KiB7555

licenseD12-May-20241.1 KiB105

package.jsonD12-May-20241.7 KiB7877

readme.mdD12-May-20241.2 KiB7741

readme.md

1# env-paths [![Build Status](https://travis-ci.org/sindresorhus/env-paths.svg?branch=master)](https://travis-ci.org/sindresorhus/env-paths)
2
3> Get paths for storing things like data, config, cache, etc
4
5Uses the correct OS-specific paths. Most developers get this wrong.
6
7
8## Install
9
10```
11$ npm install env-paths
12```
13
14
15## Usage
16
17```js
18const envPaths = require('env-paths');
19
20const paths = envPaths('MyApp');
21
22paths.data;
23//=> '/home/sindresorhus/.local/share/MyApp-nodejs'
24
25paths.config
26//=> '/home/sindresorhus/.config/MyApp-nodejs'
27```
28
29
30## API
31
32### paths = envPaths(name, [options])
33
34#### name
35
36Type: `string`
37
38Name of your project. Used to generate the paths.
39
40#### options
41
42Type: `Object`
43
44##### suffix
45
46Type: `string`<br>
47Default: `'nodejs'`
48
49**Don't use this option unless you really have to!**<br>
50Suffix appended to the project name to avoid name conflicts with native
51apps. Pass an empty string to disable it.
52
53### paths.data
54
55Directory for data files.
56
57### paths.config
58
59Directory for config files.
60
61### paths.cache
62
63Directory for non-essential data files.
64
65### paths.log
66
67Directory for log files.
68
69### paths.temp
70
71Directory for temporary files.
72
73
74## License
75
76MIT © [Sindre Sorhus](https://sindresorhus.com)
77