Socket
Socket
Sign inDemoInstall

cache-directory

Package Overview
Dependencies
3
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
Maintainers
1
Install size
58.9 kB
Created

Changelog

Source

1.0.0 - 2016-07-22

Added

  • Initial release

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

cache-directory doesn't support Windows. I will accept PRs to add this functionality, but all the docs I found were useless.

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 22 Jul 2016

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