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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sasti

v1.0.10

Published

tool to make express application using only the command line

Downloads

8

Readme

Sasti CLI

Sasti is a templating tool to make Express applications using only the command line.

Installation

Use the package manager npm to install sasti globally.

npm install sasti -g

Setting Environment Variables

After successfully installing the sasti library, it's important to configure your environment variables to enable seamless usage. Follow the steps below based on your operating system.

For macOS: Open your terminal and run the following command to set the environment variable. Replace cli-path with the actual path where you have installed sasti.

export PATH="/<cli-path>:$PATH"

For a global installation, the path typically is:

export PATH="/usr/local/lib/node_modules/sasti:$PATH"

For Windows and Linux users, set the environment variable appropriately using the method suitable for your platform.

Usage

It is a command line tool that you can use using your terminal.

sasti

CLI Options

Some of the parameters you can pass to the cli.

  • --path <path> (Specify the path replace with desired path where you want this app to be created, default is ./)
  • --name <name> (Specify the name of the project/app replace with the app name that you want to create/update, default expressApp)
  • --envs <variable-name>:<variable-value> (Specify the enviornment variable, replace with the name of the variable you want to put in the .env e.g PORT_NAME, DB_URL and to set the value of the enviroment variable replace with the actual value of the enviroment variable e.g 8080, localhost:27017 etc )
  • --port <port> (Specify the port for your app replace with the actual port, default is 8080)
  • --module <module> (Specify module for your app if you want to create a module replace with the name of the module e.g user, customer, admin etc.)
  • --middleware <middleware> (Specify the middleware for your app if you want to create a middleware replace with actual middleware name)
  • --orm <orm> (Specify the orm you want to use in the application, replace with the name of the orm that you want to use.It can only be monogoose or type-orm)
  • --model <model-name>=(<field-name>:<data-type>,<field-name>:<data-type>) (Specify model name for your database model, replace with the name of your model e.g user, customer, admin etc and to specify fields and datatype replace with field name e.g id, name, age and with data type of the field e.g String, Number, Boolen etc )

Examples

Creating a new template (application)

Create a template with default values

sasti

Create a template with properties like port, app name, path and enviroment variable

sasti --port 8080 --name express --path ../ --envs DB_HOST:"localhost",DB_PORT:"27017"

Create a template with module and middleware

sasti --module user --middleware auth

Create a template with database integration, setting up orm and database model

sasti --orm mongoose --model user{id:Number,name:String,isActive:Boolean}

Updating an existing template (application)

Add new modules, middlewares, models and environment variables by using the sasti command with existing application name.

Add new module and middleware to existing application (express).

sasti --name express --module customer --middleware logger

Add new model to existing application (express).

sasti --name express --model customer --model customer={id:Number,name:String,isAdmin:Boolean}

Add new enviroment variables to existing application (express).

sasti --name express --envs DB_USER:admin,DB_PASSWORD:1122

Usage of shortcuts

All the above properties (options) can also be used with shortcuts

  • -p, --path <project path>
  • -n, --name <project name>
  • -md, --module <module name>
  • -mw, --middleware <middleware name>
  • -e, --envs <enviroments variables>
  • -o, --orm <database orm (mongoose or sequelize)>
  • -ml, --model <database model modelName={fieldName:dataType,fieldName:dataType}>

Example

sasti --n express -p 8080 -md user -mw auth -e PORT:8080 -o mongoose -ml user={id:Number}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change Please make sure to update tests as appropriate.

Developer

linkedin