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

supermark

v1.0.0

Published

Flat-file markdown content/blog system

Downloads

14

Readme

supermark

Flat-file markdown content (read: "blog") system

Important disclaimer

This is a fun project, but I have yet to really figure out what I think belongs as "core functionality" and what should be left for the user to implement. I wouldn't say I'm very proud of the API or code yet, either. So basically, I wouldn't really use this in production if I were you, but I'd definitely appreciate any help and feedback on features and API etc.

Rough API outline

var supermark = require('supermark');

supermark.findDocuments('/path/to/dir/**/*.md', {
    allowDuplicates: false, // Produce error if multiple documents has the same slug
    glob: { /* see https://github.com/isaacs/node-glob for options */ }
}, function onDocsFound(err, docs) {
    // docs being an array of objects returned from supermark-extract
});

supermark.findBySlug('some-slug', '/path/to/dir/**/*.md', function onDocFound(err, doc) {
    // woo, found it
});

Supermark standard

The standard is simple. It's just a markdown file with an additional header of properties. This header must include at least the Title property and a horizontal rule separating the header from the document. Example:

Title: Some awesome blog post
Slug: awesome-blog-post
-----------------------------
# The content of this awesome post

Should follow here, as usual.

Allow properties:

  • Title - Required. Title of the document, kind of obvious, right?
  • Slug - A string that can be used as an identifier for the document. Should contain no spaces or special characters. Will be inferred from the title if not specified.
  • Excerpt - An excerpt of the document, as a string.
  • Date - An ISO-8601 date for when the document should be/was published.
  • Status - Either Published or Draft. Draft usually means the document won't be available to outside readers.
  • Visibility - Either Public or Private. Private usually means the document can be viewed with the right link, but does not show up in lists.
  • Author - Name and optionally email of the author, in "Name " format
  • Tags - A (markdown) list of tags for this document
  • Categories - A (markdown) list of categories this document belongs to

Usage

Check out supermark-blog for a super-simple, naive blog implemented on top of Supermark.

Random thoughts for the future

  • Some basic options to fetch posts by tag/category etc, most can be implemented in userland
  • Function to render markdown to HTML react-markdown
  • Possible editor like markdown-editor that can save to files from browser, + extraction of header?
  • Add some kind of internal link standard + renderer support? eg: [tag:whatevs], [post:slug] etc?

License

MIT-licensed. See LICENSE.