Duck Doc Go is a Visual Studio Code extension that displays npm package documentation within the editor. It allows developers to quickly access and view package documentation without leaving the comfort of their IDE.
Features
Provides a "Show Documentation" CodeLens above import statements in JavaScript and TypeScript files.
Displays the README of the imported npm package within a WebView panel in Visual Studio Code.
How it works
Duck Doc Go uses a combination of regular expressions and the npm view command to fetch and display the README content of the imported npm packages. The extension analyzes the import statements in your JavaScript and TypeScript files, and provides a "Show Documentation" CodeLens above the import lines.
When you click on the "Show Documentation" CodeLens, the extension fetches the README content of the corresponding package using the npm view command. The fetched Markdown content is then converted to HTML using the markdown-it library and displayed in a WebView panel within Visual Studio Code.
Usage
Install the Duck Doc Go extension from the Visual Studio Code Marketplace.
Open a JavaScript or TypeScript file with import statements for npm packages.
You will see a "Show Documentation" CodeLens above each import statement.
Click on "Show Documentation" to open the documentation (README) of the imported package in a WebView panel within Visual Studio Code.