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

generator-node-template

v0.0.7

Published

A Node.js service template generator for Yeoman based on hapi

Readme

generator-node-template

A Node.js service template generator for Yeoman based on hapi

Choose your tech stack and create node.js template of api service

NPM Version NPM Downloads

alt tag

Tech

Database Options
Front-end Integration Option With
  • handlebars - Handlebars provides the power necessary to let you build semantic templates effectively with no frustration.
Lint Options
Containerization Platform Options
Service Libraries
  • Hapi.js - A rich framework for building applications and services
  • bluebird - Bluebird is a fully featured promise library with focus on innovative features and performance
  • boom - HTTP-friendly error objects
  • config - Node-config organizes hierarchical configurations for your app deployments.
  • hapi-swagger - Auto swagger documentations generator
  • joi - Object schema description language and validator for JavaScript objects
  • lodash - A modern JavaScript utility library delivering modularity, performance & extras.
  • winston - A multi-transport async logging library for node.js
Process Manager
  • pm2 - Production process manager for Node.js apps with a built-in load balancer
Testing Libraries
  • jasmine - A multi-transport async logging library for node.js
  • istanbul - A JS code coverage tool written in JS
  • sinon - Standalone test spies, stubs and mocks for JavaScript

Installation

The output service template supported Node.js v4+.

Make sure you have yo installed

npm install -g yo

Install the generator globally

npm install -g generator-node-template

Run: generator-node-template and choose your preferences

yo node-template

Project Structure

.
├── config
│   ├── idefault.json
│   ├── development.json
│   ├── prod.json
├── lib
│   ├── server.js
│   └── data
│   └── api
│   └── └── models
│   └── ├── productsEndpoints.js
│   └── ... // more endpoints
│   └── infrastructure
│   └── └── hapi
│   └── └── ├── authenticationPlugin.js
│   └── └── ├── extentions.js
│   └── ├── logger.js
│   └── logic
│   └── ├── productsHandler.js
│   └── ├── authentication.js
├── templates
├── public
├── tests
│   └── integrations
│   └── units
├── index.js
├── package.json
└── readme.md

Database layer (lib/data)

index.js file expose all db models and initialize them

Logic layer (lib/logic)

contains all logics code for the endpoints

API layer (lib/api)

contains all api models and endpoints defenitions

Infrastructure code (lib/infrastructure)

contains infrastructure code (e.g: logger)

Authentication code (lib/logic/authentication.js)

authentications.js contains authenticate function which will be called with the token value for each request

Integration tests code (tests/integrations)

contains all integration tests

Units tests code (tests/units)

contains all unit tests

Q&A

Development

Want to contribute? Great! Clone the repository and push your changes

How to run it locally

Run the following command on the root project

npm link

Then every time when you run the install command it will take it from your local source code

Todos

  • Add support of new databases
  • Add tests for the generator
  • Add support of new Lints

License

MIT