node.jsnpmpackage.json

How to know what you can import from package?


Let's say there is no intellisense for node packages in Visual studio code(Sometimes intellisense doesn't work properly for a package it can't intellisense some field in the package), how do you know what you can import ?


Solution

  • You can search directly in the source code (in the node_modules folder there is a folder called as the package, find module.exports or export keywords) or check the documentation if there is one.