Every package page on npmjs.org now has a try it out link in the sidebar. These links bring you to a custom RunKit page that has a pre-filled example, so you can try the package with one click. Here's what one look likes:
By default, this will just
require the package and show you what was
exported. We've added a few custom examples, but more importantly, we've also made
a simple way for package authors to provide their own example, which we'll use to create the page.
Here's how you do it: just add the property
"runkitExample" to your
package.json, with the text of your example. Or, if you prefer,
you can set
"runkitExampleFilename" to point to a file in your package
and we'll read the example out of that file. Simple.
As always, let us know what you think!