npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pen

v2.2.0

Published

A better Markdown previewer

Downloads

319

Readme

We need a better Markdown previewer.

travis

pen is a Markdown previewer written in JavaScript, aiming to just work.

There are literally tons of Markdown previewers out there. I love some of them, I even made one of them. Nevertheless, we always need a better one, don't we?

Using pen is super simple, we don't need to install any special editor or launch any GUI application. pen is just a tidy command-line tool. You can use your favourite editor and browser. No manual refresh is even needed.

Also, the previewer renders the content using React. It means that it will not re-render entire DOM when the document is updated. This is a huge advantage because images or other media won't be reloaded for the DOM update.

I personally love to use pen, and I hope you love it too. :black_nib:

Demo

Here is a short demo showing how awesome pen is.

demo

The following demo shows pen incrementally updates only modified part using React and its Reconciliation.

incremental update

Requirement

pen uses Node.js >= 4.0. It may not work on earlier versions.

Install

Using npm:

npm i -g pen

You can try using pen with npx:

npx pen

Usage

To use pen, simply run the pen command.

pen README.md

The command above will launch a pen server and open the file in your default browser. The server will listen to a 6060 port by default. To be honest, you don't even need to launch it with a filename. You can manually open http://localhost:6060/README.md, or any other files in the same directory.

To stop the server, enter ^C.

For the further details of the pen command, please enter pen -h or pen --help.

Pandoc

Pen uses markdown-it as Markdown parser by default, but it also supports Pandoc. Please provide a proper Pandoc format for the value.

pen --pandoc gfm README.md

Contribution

I welcome every contribution on pen. You may start from forking and cloning this repo.

git clone [email protected]:your_username/pen.git
cd pen

# Install dependencies
npm i

# Lint, build, and test pen codes at once
npm test

To build frontend scripts:

npm run build

To lint with ESLint:

npm run lint

To test with Mocha

npm run mocha

License

Pen is released under the MIT License.