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

coquito-cli

v0.0.34

Published

CLI tool for CoquitoJS

Downloads

5

Readme

Coquito-CLI

Read Documentation for Coquito Framework here

Installing

npm install -g coquito-cli

newbasicproject

Create a new Coquito Project from the base template with the following command.

coquito newbasicproject

you can also specify the folder name like so:

coquito newbasicproject folderName

newbasicproject

Create a new Coquito Project from the Typescript template with the following command.

coquito newtsproject

you can also specify the folder name like so:

coquito newtsproject folderName

scaffold

create an empty directory and create a "scaffold.js" that looks like this:

{
    "graphql": false,
    "rpc": false,
    "routers": [],
    "models" : ["Dog", "Cat"]
    "bodyparsers": false,
    "views": "hamlet",
    "port": 4444,
    "host": "0.0.0.0",
    "static": false,
    "package": {
        "name":"my-app",
        "description": "this is my-app",
        "author": "Alex Merced",
        "email": "[email protected]",
        "repo": "http://github.com/..."
    },
    "db": "sql-sqlite3",
    "auth": "sql",
    "logging": true,
    "methodOverride": true
}

Then run the command

coquito scaffold

You project will be scaffolded in the directory. If the config file is somewhere else or under a different name can specify location like this:

coquito scaffold ./scaffold/config.json

  • Supported View Engines ["ejs", "pug", "hbs", "liquid", "nunjucks", "mustache","twig","hamlet"]

  • If you don't need a view engine, just assign false or don't include the property

  • values for auth can be "sql" or "mongo", all other values will be ignored an no auth will be added.

  • "methodOverride" property will let you override method on form requests by adding a url query in the formal of ?_method=DELETE in the form action attribute.

  • "logging" will add the morgan logging middleware.

  • "routers" will add just a blank controller for each endpoint, "models" will create a model file, rest routes and a router for each model specified.

  • If you have a static folder and graphql or rpc turned on a "clients.js" will be created that provides some basic frontend GraphQL and SimpleRPC clients to use in your frontend code.

  • You can prepopulate the DATABASE_URL env variable with the dburi property in your scaffold.json

  • the SECRET env variable will be pre-populated with a random UUID, feel to change it if you like.

  • You can prepopulate auth with "auth":"mongo" or "auth":"sql" and if done at time of scaffolding the sessions and cookieParser middeware will be pre-registered. Read the comments in ./auth/functions.js

add-mongo

Scaffold connection file for using mongo

coquito add-mongo

add-mongo-model

Scaffold a mongo model file.

coquito add-mongo-model Dog

add-rest-routes

Add a new controller file with Index, Show, Create, Update and Delete routes scaffolding for easy CRUD route building.

coquito add-rest-routes dog

add-sql

Scaffold a Sequalize connection file for connecting to sql databases. Install sequelize and libraries for specified database.

coquito add-sql sqlite3

database options

["pg", "mysql2", "sqlite3", "mariadb", "oracledb", "MSSQL"]

add-auth

These commands will do the following to speed up implementing auth:

  • Generate a User Model
  • install bcryptjs, express-session and jsonwebtoken
  • create ./auth/functions.js which will have several functions that you can use to compose JWT to session based auth in your Rest/RPC/Graphql APIs

add-auth-mongo

add-auth-sql