chalouni
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

chalouni

CLI tool to create

  • new project
  • code snippets and
  • files with code snippets.

Files:

  • Controller
  • Model
  • Interface

Snippets

  • Interface
  • Mongoose document schema

[TOC]

Install

npm install chalouni -g

Install this tool in global scope.

If installed local scope run it using npx chalouni

Usage

Create new project

CD to directory where you want to create folder

chalouni --project PROJECT-NAME
# results same
chalouni -p PROJECT-NAME

Creates new project in same directory command ran from.

Code snippets and files

CD to your project cd path/to/your-project

Controller File

creates controller

chalouni -c user

Creates new file src/controllers/User.ts

Model and Interface File

creates both model and interface

chalouni -m user

Creates new files src/models/User.ts and src/interface/IUser.ts

Snippets

Output code snippets to console.

Requires 2 parameters

1st option is --snippet or -s

other supported options are

  • -i or --interface for interface
  • -d or --db for mongodb document (mongoose schema)

i and d options are only valid with --snippet or -s option

Example

# Interface snippet
chalouni --snippet -interface "name,age,birthday"

# Alias for above code
chalouni -s -i "name,age,birthday"

# Mongoose document schema snippet
chalouni --snippet -db "name, age, birthday"

# Alias for above code
chalouni -s -d "name,age,birthday"

Output example:

// Interface snippet
export interface IChangeMe {
  name: string;
  age: string;
  birthday: string;
}
// Mongoose schema snippet
{
  name: {type: String},
  age: {type: String},
  birthday: {type: String},
}

Structure

  • ./template - handlebar template

Package Sidebar

Install

npm i chalouni

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

17.3 kB

Total Files

21

Last publish

Collaborators

  • akashthapa7