This node module is a response to a common need I found when developing node projects: needing to see the documentation of the other modules I was using. This was usually a multi-step process: open a browser, search for the module and find its homepage. docs-for tries to make it go faster.
docs-for accepts a string input and will search upwards in the directory structure for a package.json file. It will then look for the best module name match for the name given, find that module's package, use it to locate the most likely url for documentation and try to open it in a web browser.
Because of the naming conventions of modules the best module name match is (in order): exact match, tail match, head match, body match.
This module loads two executables docs-for and the alias docs4. These will try to load the docs for a package in your current node project if you are anywhere in the project hierarchy.
docs4 lodash# opens a browser window fordocs4 comm# opens a browser window (tab) for
Find the closest thing to a documentation url for a module in a local node project. Accepts a string for the module name or a configuration object, with:
- name - the name or partial name of the module
- from - the directory from which to start the search for the module, defaults to the current process directory
var docs4 = ;;;