title: Where should I store cache of a custom CLI npm module?
body: <p>I am developing an npm module, where user can interact with it through a terminal by executing commands:</p>
  
  <pre><code>&gt; mymodule init
  &gt; mymodule do stuff
  </code></pre>
  
  <p>When executing certain commands user is being asked for some data, which will be used by the module. Since this data won't really change while using the module and since these commands can be executed pretty frequently, it is not the best option to ask user for the data any time he runs a command. So I've decided to cache this data, and as soon as it should live through multiple module calls, the easiest way to store it that I see is a file (the data structure allows to store it in a simple JSON). But I am to quite sure where should this file go on a user's machine.</p>
  
  <p><strong>Where in the file system should I store a cache in a form of a file or multiple files for a custom npm module, considering that the module itself can be installed globally, on multiple operation systems and can be used in multiple projects at the same time?</strong></p>
  
  <p>I was thinking about storing it in a module's folder, but it might be tricky in case of global installation + multi-project use. The second idea was to store it in OS specific tmp storage, but I am not quite sure about it too. I am also wondering if there are some alternatives to file storage in this case.</p>