1.0.1 • Published 7 years ago
documents-folder v1.0.1
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-folderAPI
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
1.0.1
7 years ago