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 🙏

© 2025 – Pkg Stats / Ryan Hefner

dumblog

v0.1.2

Published

A dumb blog model for easy integration

Readme

Dumblog

Why? Because it's dumb and easy to integrate.

Requirement

None (!)

Install

$ npm i dumblog --save

Usage

var Blog = require('dumblog').Blog;

var blog = new Blog(__dirname + '/blog/articles', {
  fileRegExp: /\.md$/
});

var articles = blog.articles();

This will find all articles matching '*.md' in blog/articles directory.

Articles

You may write articles in any format you like but, dumblog expects to find email-like meta information at the beginning of each article files AND an EMPTY line before the content:

from: orion
subject: New article!
foo: bar

The article's content starts here after a __REQUIRED__ empty line...

Meta

You can put any meta attributes in your articles. If an attribute is expected to be an array, then separate each elements with commas like so:

tags: foo, bar, baz

And of course you need to tell dumblog that the 'tags' meta is an array. Why? Because Dumblog is so dumb!

var blog = new Blog(__dirname + '/blog/articles', {
  multiple: ['tags']
});

By default, meta.tags is known (Huh.. at least one thing it knows :) to be an array.

You can also define default metas for articles:

var blog = new Blog(__dirname + '/blog/articles', {
  meta: {
    from: 'me',
    subject: 'no idea'
  }
});

Each article's metas will override these default values.

Accessors

An article has 2 main accessors:

  • meta: the meta information read while parsing the file. It is an Object of key/values
  • content: the raw content as read while parsing the file. It is a String.
var article = articles[0];
console.log(article.meta.from, article.content);

On top of which article file modification and access time are automatically recorded in the meta object:

var article = articles[0];
console.log(article.meta.modified_on, article.meta.accessed_on);

They are both Date objects

Callbacks

To very easily accomodate any format like markdown, textile etc ... Dumblog is totally agnostic (Heh!).

What you should do is provide your own transformation to the articles' raw content in a "onArticle" callback like so:

var 
  marked = require('marked')
  
  blog = new Blog(__dirname + '/blog/articles', {
    onArticle: function (article) {
      article.HTMLContent = marked(article.content);
    }
  });

You can also provide a sort function so that articles will be sorted the right way when they are fetched:

var blog = new Blog(__dirname + '/blog/articles', {
  sort: function (a, b) {
    return a.meta.modified_on > b.meta.modified_on
  }
});

License

Copyright (c) 2014, Thierry Passeron MIT License