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

doubleb.js

v0.1.2

Published

Simple and limited template system designed for speed.

Readme

doubleb.js

npm
doubleb.js is a simple and limited template system designed for projects that require more speed when generating simple static and dinamyc pages.

Getting started

Prerquisites

To use doubleb.js you only need to have Node.js > = 10.16.3 preinstalled.

Installation

There is a npm package that you can install running:

npm install doubleb.js

Usage

The only way to use doubleb.js for now is through the API.

API

The npm module, loaded with const doubleb = require("doubleb.js"); exposes the following functions and variables.

function doubleb([config_path="./_config.json"])

Reads the configuration file, renders the input files and saves them in the output directory.

function doubleb.read_config([config_path="./_config.json"])

Reads the configuration file in the specified path and returns the JSON Object of the configuration.

function doubleb.render(config)

Renders config.data, with the template config.template, if present.

function doubleb.middleware(config)

Middleware wrapper for render(config).

function add_handler(name, regex, callback)

Only for custom regular expression handlers

Adds a handler for the regular expression regex with name name.

var doubleb.config

Only for custom regular expression handlers

Is the current configuration readed by doubleb.read_config([config_path="./_config.json"]).

Configuration file

The configuration file looks like the this:

{
  "$input_dir": "/some/path",
  "$ouput_dir": "/some/other/path",
  "$exclude": "(.*).png$",
  "variable_name": "value",
  "extension_variable": ["value", "value0", "abcdwxyz"]
}

Where $input_dir is the input directory with the files to be rendered and $output_dir is the output directory of the rendered files. variable_name and extension_variable are just examples. All the fields are optional.

Examples

For examples, look at the test folder.

Licensing

All the code of this project is licensed under the Apache License version 2.0 (Apache-2.0).

	Copyright 2019 Álvaro Torralba <[email protected]>

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

		http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
	

All the documentation of this project is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

CC BY-SA