source: trip-planner-front/node_modules/env-paths/readme.md@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.1 KB
RevLine 
[6a3a178]1# 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
34Note: It only generates the path strings. It doesn't create the directories for you. You could use [`make-dir`](https://github.com/sindresorhus/make-dir) to create the directories.
35
36#### name
37
38Type: `string`
39
40Name of your project. Used to generate the paths.
41
42#### options
43
44Type: `object`
45
46##### suffix
47
48Type: `string`<br>
49Default: `'nodejs'`
50
51**Don't use this option unless you really have to!**<br>
52Suffix appended to the project name to avoid name conflicts with native
53apps. Pass an empty string to disable it.
54
55### paths.data
56
57Directory for data files.
58
59Example locations (with the default `nodejs` [suffix](#suffix)):
60
61- macOS: `~/Library/Application Support/MyApp-nodejs`
62- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Data` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Data`)
63- Linux: `~/.local/share/MyApp-nodejs` (or `$XDG_DATA_HOME/MyApp-nodejs`)
64
65### paths.config
66
67Directory for config files.
68
69Example locations (with the default `nodejs` [suffix](#suffix)):
70
71- macOS: `~/Library/Preferences/MyApp-nodejs`
72- Windows: `%APPDATA%\MyApp-nodejs\Config` (for example, `C:\Users\USERNAME\AppData\Roaming\MyApp-nodejs\Config`)
73- Linux: `~/.config/MyApp-nodejs` (or `$XDG_CONFIG_HOME/MyApp-nodejs`)
74
75### paths.cache
76
77Directory for non-essential data files.
78
79Example locations (with the default `nodejs` [suffix](#suffix)):
80
81- macOS: `~/Library/Caches/MyApp-nodejs`
82- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Cache` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Cache`)
83- Linux: `~/.cache/MyApp-nodejs` (or `$XDG_CACHE_HOME/MyApp-nodejs`)
84
85### paths.log
86
87Directory for log files.
88
89Example locations (with the default `nodejs` [suffix](#suffix)):
90
91- macOS: `~/Library/Logs/MyApp-nodejs`
92- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Log` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Log`)
93- Linux: `~/.local/state/MyApp-nodejs` (or `$XDG_STATE_HOME/MyApp-nodejs`)
94
95### paths.temp
96
97Directory for temporary files.
98
99Example locations (with the default `nodejs` [suffix](#suffix)):
100
101- macOS: `/var/folders/jf/f2twvvvs5jl_m49tf034ffpw0000gn/T/MyApp-nodejs`
102- Windows: `%LOCALAPPDATA%\Temp\MyApp-nodejs` (for example, `C:\Users\USERNAME\AppData\Local\Temp\MyApp-nodejs`)
103- Linux: `/tmp/USERNAME/MyApp-nodejs`
104
105---
106
107<div align="center">
108 <b>
109 <a href="https://tidelift.com/subscription/pkg/npm-env-paths?utm_source=npm-env-paths&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
110 </b>
111 <br>
112 <sub>
113 Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
114 </sub>
115</div>
Note: See TracBrowser for help on using the repository browser.