Quick and Easy READMEs with vmd

2015-10-24 08:37:25

The view subcommand of npm is pretty cool. It will happily print any property of the package to standard output.

{% highlight bash %} $ npm view twitter-rss-server dependencies

{ configstore: ‘^1.2.1’, prompt: ‘^0.2.14’, rss-twitter: ‘0.0.2’ } {% endhighlight %}

This extends to the project’s README, too!

{% highlight bash %} $ npm view prompt readme | head

prompt Build Status

A beautiful command-line prompt for node.js


Combine this with the markdown viewer vmd, which reads markdown on standard input and creates an Electron window with its parsed output:

{% highlight bash %} $ npm view prompt readme | vmd {% endhighlight %}

Super handy for referring to a project’s documentation without needing to fire up the browser and go searching.

Happy hacking!