https://github.com/hobbyquaker/persist-path
Get OS-specific path to store persistent data :file_folder:
https://github.com/hobbyquaker/persist-path
appdata file home library node-module operating-system os path persist user
Last synced: about 1 month ago
JSON representation
Get OS-specific path to store persistent data :file_folder:
- Host: GitHub
- URL: https://github.com/hobbyquaker/persist-path
- Owner: hobbyquaker
- License: mit
- Created: 2016-08-30T11:43:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-13T20:08:14.000Z (over 5 years ago)
- Last Synced: 2024-10-25T22:43:39.151Z (7 months ago)
- Topics: appdata, file, home, library, node-module, operating-system, os, path, persist, user
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# persist-path
[](http://badge.fury.io/js/persist-path)
[](https://gemnasium.com/github.com/hobbyquaker/persist-path)
[](https://github.com/sindresorhus/xo)
[![License][mit-badge]][mit-url]> Get OS-specific path to store persistent data
## Usage
```npm install persist-path```
```Javascript
var ppath = require('persist-path')();
```## OS-specific Paths
### Linux/BSD
If you supply an argument to the required function call this will be appended as .dot directory.
Example:
```Javascript
var ppath = require('persist-path')('myproject/settings');console.log(ppath); // /home//.myproject/settings
```### macOS
If you supply an argument to the required function call this will be appended on Library/Preferences in the Users home
Example:
```Javascript
var ppath = require('persist-path')('myproject/settings');console.log(ppath); // /Users//Library/Preferences/myproject/settings
```### Windows
If you supply an argument to the required function call this will be appended on Users %appdata% dir
# License
MIT (c) 2016 [Sebastian Raff](https://github.com/hobbyquaker)
[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat
[mit-url]: LICENSE