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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nasher

v0.3.0

Published

Yet another static site generator written in NodeJs

Readme

Nasher

Yet another static site generator written in NodeJs.

Nasher is my 2nd attempt in making Static-Site-Generator.

The idea behind Nasher is to build an extensible system which can be easily extended via plugins which can modify the output to include additional features (such as seo optimization, embedding of dynamic features such as Disqus comments, Sliders )

Out of the box Nasher support converting of Markdown files to HTML and supports Handlebars as a templating language.

Nasher works in 4 main stages

|----------|     |---------|     |----------|    |----------|
| Analyze  |---->| Apply   |---->| Convert  |--->| Render   |
|          |     | Plugins |     | Markdown |    | using    |
|          |     |         |     |   to     |    | templates|
|          |     |         |     |          |    |  HTML    |    
|----------|     |---------|     |----------|    |----------|

Nasher is designed in such a way that it is easy it integrate with other projects.

Let's have a look at how to use nasher.

Step 1) Install Nasher Package

   npm install nasher --save

Step 2) Create a config.json file

Basic structure:

{
   "site": {
       "title": 'My Site'
   },
   "baseurl": "/",
   "documents_dir": './documents',
   "home_dir": '.',
   "build_dir": './build',
   "theme_dir": './theme',
   "default_layout": 'index',
   "site_assets":"./assets",
   "process_tree":false
   "process_tree": true,
  
   "theme_dir": "./theme",
   "site_assets":"./assets",
   "pagination" : {
       "limit": 10,
        "dir" : {
            "<dir name>": {
                "sortBy":"date",
                "create_index": true
            },
            "<dir name>": {
                "sortBy":"date",
                "create_index": true
            }
        },
        "taxonomy": {
            "<type>": {
                "sortBy":"date",
                "create_index": true
            },
            "<type>": {
                "sortBy":"date",
                "create_index": true
            }
        }
   }
}

Step 3 Create runner.js(name of the file can be anything) file Basic Example:

const {Nasher} = require('nasher');
const glob = require('glob');
const fs = require('fs');
const path = require('path');
let nasher = new Nasher('./config.json');

nasher.plugin(function (config, meta, files) {
   ...
});

nasher.theme(function theme(config, engine) {
   // for now consider we are sticking to handlebars
   let theme_dir = config.theme_dir;
   let theme_main_files = glob.sync(path.join(theme_dir, '!(partials|scripts|css)'));
   let theme_partials_files = glob.sync(path.join(theme_dir, 'partials', '*'));
   let theme_helpers_files = glob.sync(path.join(theme_dir, 'scripts', '*.js'));
  
   let theme_partials = theme_partials_files.reduce(function (acc, val) {
       let content = fs.readFileSync(val);
       let partial_name = path.basename(val, '.hbs');
       acc[partial_name] = content.toString();
       return acc;
   }, {});

   let theme_helpers = theme_helpers_files.reduce(function (acc, val) {
       let content = require(path.join(process.cwd(), val));
       let partial_name = path.basename(val, '.js');
       acc[partial_name] = content;
       return acc;
   }, {});


   Object.keys(theme_helpers).forEach(function (key) {
       engine.registerHelper(key, theme_helpers[key]);
   });

   Object.keys(theme_partials).forEach(function (key) {
       engine.registerPartial(key, theme_partials[key]);
   });

   return theme_main_files.reduce(function (acc, val) {
       let content = fs.readFileSync(val).toString();
       let template_name = path.basename(val, '.hbs');
       acc[template_name] = engine.compile(content);
       return acc;
   }, {});
});

nasher.build();

To see a live example of Nasher in action, have look at the zeroth.me website. You can have a look at the code here https://github.com/zeroth-experiments/zeroth.me