Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including downloads-folder with all npm packages installed. Try it out:

var downloadsFolder = require("downloads-folder")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

downloads-folder v1.0.1

Get the local downloads folder, for all major platforms

downloads-folder

Get the local downloads folder, for all major platforms.

Usage

const downloadsFolder = require('downloads-folder');

console.log(downloadsFolder());

Installation

$ 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: ~/Downloads
  • *nix: xdg-user-dir DOWNLOAD || ~/Downloads || /tmp

License

MIT

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free