title: Easiest way to discover modules' APIs in JavaScript?
body: <p>I'm comparing the developer experience between JavaScript and Java. While there are many things that are more &quot;elegant&quot; in JS, one thing I struggle with is figuring out how to use modules from npm.</p>
  <p>For example, take morgan, the logging dependency for express. After some googling and looking at the docs, it's apparent that you can use it like this:</p>
  <pre><code>app.use(morgan('combined', { stream }));
  </code></pre>
  <p>IntelliJ helpfully hints the first parameter is 'format' and the second one is 'options'.</p>
  <p>In Java, I would expect an enum for the standard definitions of format, and I would be able to figure out that stream is a property of the options object just by inspecting it in the IDE - not possible for morgan in this case since the source code just reads &quot;arbitrary&quot; properties of the supplied object.</p>
  <p>Am I right in thinking that in the JS world, it's the docs or reading source code for cases such as this? Is there something I'm missing? My question is not specifically about morgan, this is just an example but I find myself running into this type of issue a lot as a beginner node user.</p>