Socket
Socket
Sign inDemoInstall

cache-directory

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cache-directory

Find the proper cache directory based on operating system


Version published
Weekly downloads
26K
increased by7.73%
Maintainers
1
Install size
50.9 kB
Created
Weekly downloads
 

Changelog

Source

2.0.0 - 2018-03-01

Changed

  • os.homedir() is used directly instead of a ponyfill

Breaking

  • Node 4 is now required

Readme

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

Last updated on 01 Mar 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc