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

newa

v1.1.3

Published

Cli for Node Express Web Api (NEWA) with typescript

Readme

NEWA-CLI

A cli for Node Express Web Api (NEWA).

Usage

Install newa-cli globally.

npm install newa -g

Newa new and generate.

Create a project, generate model, repository, business and controller.

New synopsis

newa n|new your-project-name --e|--example

The above command will create a new project by the name of your-project-name the flag --e|--example is optional and if used, it will create an example project.

Generate synopsis

newa g|generate [<type>] [<modelname>]

Details

Automatically create project and MRBC for your project.

The generated files are all based on a existent Model, so you have to create the Model first.

For example, newa generate model user creates a model by the name of User in src/Models/Database/.

newa generate repository user creates a repository by the name of UserRepository in src/Repository/Repositories/ .

newa generate business user creates a business by the name of UserBusiness in src/Business/Rules/ .

newa generate controller user creates a controller by the name of UserController in src/Controller/Controllers/ .

newa generate all user creates a model, repository, business and controller .

| Input | Description
| ------------- | ------------- | type | The type of generator (e.g. model, repository, business, controller) | modelname | The name of the model.

| Option | Description
| ------------- | ------------- | --t\|--table my-table-name | Generates a model refering to a diferent table name, instead of using model name as table name. | --env\|--environment my-environment | Sets the environment (production, development, local) to be used when generating a model.

Examples

newa new <projectname> --example

newa generate model <modelname> --table <tablename> --environment  <environmentname>

newa generate repository <modelname>

newa generate business <modelname>

newa generate controller <modelname>

newa generate all <modelname> --table <tablename> --environment  <environmentname>

shortcuts:

newa n <projectname> --example

newa g m <modelname> --t <tablename> --env  <environmentname>

newa g r <modelname>

newa g b <modelname>

newa g c <modelname>

newa g a <modelname> --t <tablename> --env <environmentname>

Definitions

  • MRBC - abbreviation for model, repository, business and controller.
  • Model - Representation of a table in your database.

Resources (available only for example projects).

You can find a dump file of the database and postman resources that were used in this project on "resources/" folder.

Just import them and you are good to go.

Development Hints for working on NEWA CLI

Prerequisites

Node.js

First install Node.js, recomended to download any stable version above 8.11.1

Installing Dependencies

Install typescript globally.

npm install -g typescript 

Install the dependencies listed inside of package.json file.

npm install 

Running the project.

To compile typescript files and watch for changes use this command.

npm run watch:build

or if you just want to compile then run:

tsc

To server the cli you can either type once:

npm link

and then just type newa commands normally or type

node /dist/app.js