documents-folder
Get the local documents folder, for all major platforms.
Usage
const documentsFolder = require('@myrpc/documents-folder');
console.log(documentsFolder());
Installation
$ npm install @myrpc/documents-folder
# OR
$ yarn add @myrpc/documents-folder
API
documentsFolder()
Return the location of the documents folder for the current platform.
Warning: On *nix, this will perform synchronous operations, so don't place it where concurrency is required. It's probably the best to just determine this folder once when your application starts.
Algorithm
- Mac OS X:
~/Documents
- Windows:
~/Documents
- *nix:
xdg-user-dir DOCUMENTS
||~/Documents
||/tmp
License
MIT