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

basic_node_project_template

v1.0.5

Published

A basic starter boilerplate project for node

Readme

This is a base node js project template, which anyone can use as it has beenprepared, by keeping some of the most important code principles and project management recommendations. Feel free to change anything.

src -> Inside the src folder all the actual source code regarding the project will reside, this will not include any kind of tests. (You might want to make separate tests folder)

Lets take a look inside the src folder

  • config -> In this folder anything and everything regarding any configurations or setup of a library or module will be done. For example: setting up dotenv so that we can use the environment variables anywhere in a cleaner fashion, this is done in the server-config.js. One more example can be setup your logging library that can help you to prepare meaningful logs, so configuration for this library should also be done here.

  • routes -> In the routes folder, we register a route and the corresponding middleware and controllers to it.

  • middlewares -> They are just going to intercept the incoming requests where we can write our validators, authenticators, etc.

  • controllers -> They are kind of the last middlewares as post them you call business layer to execute the business logic. In controllers we just recieve the incoming requests and data and the pass it to the business layer, and once business layer returns an output, we structure the API response in controllers and send the output.

  • repositories -> This folder contains all the logic using which we interact the DB by writing queries, all the raw queries or ORM queries will go here.

  • services -> Contains all the business logic and interacts with the repositories for data from the database.

  • utils -> Contains Helper methods, error classes, etc.

Setup the Project

  • Download this template from github and open it in your favourite text editor.
  • Go inside the folder path and execute the following command:
        npm install
  • In the root directory create a .env file and add the following env variable
        PORT = <port number of your choice>
    example:
        PORT = 3000
  • Go inside the src folder and execute the following command:
        npx sequelize init
  • By executing the following command you will get the migrations and seeders folder along with a config.json file inside the config folder.
  • Inside the src/config.json folder create a file named config.json and write the following code:
        {
            "development": {
                "username": "root",
                "password": "mypassword",
                "database": "database_development",
                "host": "127.0.0.1",
                "dialect": "mysql"
            },
            "test": {
                "username": "root",
                "password": null,
                "database": "database_test",
                "host": "127.0.0.1",
                "dialect": "mysql"
            },
            "production": {
                "username": "root",
                "password": null,
                "database": "database_production",
                "host": "127.0.0.1",
                "dialect": "mysql"
            }
        }
    
  • If you are setting up your development environment, then write the usename of your db, password of your db and in dialect mention whatever db you are using for ex: mysql, sqlite, mariadb, etc.
  • If you are setting up your test or prod environment, make sure you also replace the hosted db url.
  • To run the server execute the following command :
        npm run dev