1.0.1 • Published 5 years ago

@myrpc/documents-folder v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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