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

cache-directory

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-directory

Find the proper cache directory based on operating system

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
38K
increased by12.02%
Maintainers
1
Weekly downloads
 
Created
Source

cache-directory

Find the proper cache directory based on operating system

Installation

npm install cache-directory

Usage

cache-directory takes one argument, the app name.

var cacheDir = require('cache-directory');

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

Caveats

When run on OS X, cache-directory assumes it isn't run in a sandboxed process environment. If it is, it will probably break. Additionally, the app name is used instead of the conventional bundle identifier (for simplicity and because many cache-directory consumers won't necessarily have a bundle identifier).

If a suitable cache directory can't be found, cache-directory will return null. You need to handle this case. A reasonable course of action would be to use a temp directory, for which you can use the cache-or-tmp-directory module.

License

LGPL 3.0+

Author

Alex Jordan alex@strugee.net

Keywords

FAQs

Package last updated on 01 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