Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cache-or-tmp-directory

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-or-tmp-directory

Get the cache directory or, failing that, a temporary directory

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

cache-or-tmp-directory

Get the cache directory or, failing that, a temporary directory

Installation

npm install cache-or-tmp-directory

Usage

cache-or-tmp-directory takes one argument, the app name.

var cacheOrTmpDir = require('cache-or-tmp-directory');

console.log(cacheOrTmpDir('myApp'));

Caveats

cache-or-tmp-directory won't create the directory for you, just give you a path. You have to create it yourself.

Also, temporary directories are constructed as $TMPDIR/node-cache-or-tmp-directory/$APPNAME, where $TMPDIR is the operating system's temporary directory and $APPNAME is what you passed to the module. An important consequence of this is that there is no random component in the path, as is conventional for temporary stuff. This is because it's assumed you'll use this for caches (duh) so you actually want (say) multiple concurrent processes to get the same path, or two consecutive runs to get the same path and thus share a cache.

See also cache-directory's caveats.

License

LGPL 3.0+

Author

AJ Jordan alex@strugee.net

Keywords

FAQs

Package last updated on 02 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc