Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliangruber/downloads-folder
Get the local downloads folder, for all major platforms
https://github.com/juliangruber/downloads-folder
Last synced: 13 days ago
JSON representation
Get the local downloads folder, for all major platforms
- Host: GitHub
- URL: https://github.com/juliangruber/downloads-folder
- Owner: juliangruber
- Created: 2016-05-26T20:50:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-19T01:18:38.000Z (4 months ago)
- Last Synced: 2024-10-17T19:58:02.082Z (26 days ago)
- Language: JavaScript
- Size: 1.14 MB
- Stars: 32
- Watchers: 4
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# downloads-folder
Get the local downloads folder, for all major platforms.
## Usage
```js
const downloadsFolder = require('downloads-folder');console.log(downloadsFolder());
```## Installation
```bash
$ npm install downloads-folder
```## API
### downloadsFolder()
Return the location of the downloads 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: `~/Downloads`
- Windows: `Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders{374DE290-123F-4565-9164-39C4925E467B}` || `~/Downloads`
- *nix: `xdg-user-dir DOWNLOAD` || `~/Downloads` || `/tmp`## License
MIT