Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
index.d.ts | D | 12-May-2024 | 1.4 KiB | 70 | 17 | |
index.js | D | 12-May-2024 | 2.1 KiB | 75 | 55 | |
license | D | 12-May-2024 | 1.1 KiB | 10 | 5 | |
package.json | D | 12-May-2024 | 1.7 KiB | 78 | 77 | |
readme.md | D | 12-May-2024 | 1.2 KiB | 77 | 41 |
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