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 🙏

© 2025 – Pkg Stats / Ryan Hefner

create-nexlify

v1.0.3

Published

A CLI tool to scaffold Node.js projects with TypeScript/JavaScript, databases, validators, and middlewares.

Readme

create-nexlify

A CLI tool to scaffolder Node.js projects with support for TypeScript or JavaScript, multiple databases, validators, middlewares, Swagger documentation, and Jest tests.

Features

  • Languages: Generate projects in TypeScript or JavaScript.
  • Multilinguism: Supports English and French for error messages and documentation.
  • Databases: MongoDB, PostgreSQL, MySQL, or none.
  • Validators: Zod, Joi, or none.
  • Middlewares: Helmet, CORS, rate-limit, Morgan, compression, JWT authentication.
  • Documentation: Optional Swagger UI for API endpoints.
  • Testing: Jest with Supertest for API tests.
  • Entities: Define custom entities with fields (e.g., User with name:string,email:string,password:string).

Installation

Install globally with npm:

npm install -g create-nexlify

Or use without installing via npx:

npx create-nexlify

Usage

Run the CLI to start the interactive setup:

create-nexlify

The CLI will prompt you for configuration options:

  • Language: Choose Français or English.
  • Project Type: TypeScript or JavaScript.
  • Project Name: e.g., my-api.
  • Description: Optional project description.
  • Package Manager: npm, yarn, or pnpm.
  • Database: MongoDB, PostgreSQL, MySQL, or None / Aucune.
  • Database URL: e.g., postgres://user:pass@localhost:5432/my-api.
  • Validator: Zod, Joi, or None / Aucun.
  • Swagger: Enable (Oui) or disable (Non) Swagger.
  • Middlewares: Choose multiple (Helmet, CORS, JWT, etc.).
  • JWT Secret: Required if JWT selected (e.g., mysecretkey).
  • Entities: Define entities and their fields (e.g., User with name:string,email:string,password:string).
  • Install Dependencies: Choose to install now (Oui) or later (Non).

Example Interaction

? Quelle langue souhaitez-vous utiliser ? Français
? Quel type de projet voulez-vous créer ? TypeScript
? Quel est le nom de votre projet ? my-api
? Entrez une description du projet (optionnel) : API de gestion d'utilisateurs
? Quel gestionnaire de paquets ? npm
? Quelle base de données ? PostgreSQL
? Entrez l'URL de connexion (optionnel) : postgres://testuser:testpass@localhost:5432/my-api
? Quel validateur ? Joi
? Voulez-vous inclure la documentation Swagger ? Oui
? Quels middlewares ? Helmet, CORS, JWT
? Entrez une clé secrète pour JWT : mysecretkey
? Quelles entités ? User
? Quels champs pour User ? name:string,email:string,password:string
Génération des fichiers... ✅ Projet "my-api" généré avec succès !
? Voulez-vous installer les dépendances maintenant ? Oui
Installation des dépendances... ✅ Dépendances installées avec succès !

Project Structure

my-api/
├── src/
│   ├── controllers/
│   │   └── userController.ts
│   ├── middlewares/
│   │   └── authMiddleware.ts
│   ├── models/
│   │   └── User.ts
│   ├── routes/
│   │   ├── authRoutes.ts
│   │   └── userRoutes.ts
│   ├── validators/
│   │   └── userValidator.ts
│   ├── index.ts
│   └── swagger.json
├── tests/
│   └── user.test.ts
├── .env
├── jest.config.ts
├── package.json
├── README.md
└── tsconfig.json

Running the Generated Project

cd my-api

Install dependencies if not yet done:

npm install

Configure the database:

psql -U testuser -c "CREATE DATABASE my-api;"

Update your .env file:

PORT=3000
DATABASE_URL=postgres://testuser:testpass@localhost:5432/my-api
JWT_SECRET=mysecretkey

Compile TypeScript (if applicable):

npm run build

Start the server:

npm start

Run tests:

npm test

API Endpoints

POST /api/auth/register

Body:

{
  "name": "John Doe",
  "email": "[email protected]",
  "password": "password123"
}

Response:

{
  "message": "Utilisateur enregistré",
  "user": { ... }
}

POST /api/auth/login

Body:

{
  "email": "[email protected]",
  "password": "password123"
}

Response:

{
  "token": "jwt-token"
}

POST /api/users

Headers:

Authorization: Bearer <jwt-token>

Body:

{
  "name": "Jane Doe",
  "email": "[email protected]",
  "password": "password123"
}

Response:

{
  "name": "Jane Doe",
  "email": "[email protected]",
  ...
}

GET /api/users

Headers:

Authorization: Bearer <jwt-token>

Response:

[
  {
    "name": "John Doe",
    "email": "[email protected]",
    ...
  }
]

Configuration Details

.env File

  • PORT: Server port (default: 3000)
  • DATABASE_URL: e.g., postgres://user:pass@localhost:5432/db
  • JWT_SECRET: JWT token secret

tsconfig.json

  • ES2020
  • CommonJS
  • Strict typing
  • Output: ./dist

jest.config.ts

  • Uses ts-jest
  • Supports TypeScript testing

Troubleshooting

Syntax Errors in Generated Files

Check your version:

create-nexlify --version

Update:

npm install -g create-nexlify@latest

Database Connection Errors

Ensure server is running and .env is correctly set.

For PostgreSQL:

psql -U testuser -h localhost -d my-api

TypeScript Compilation Errors

npm install
npm run build

Check tsconfig.json.


Test Failures

Ensure you have:

npm install --save-dev jest ts-jest supertest

Verify jest.config.ts.


Contributing

  1. Fork: https://github.com/Le-Sourcier/create-nexlify.git
  2. Create branch: git checkout -b feature/your-feature
  3. Commit: git commit -m "Add your feature"
  4. Push: git push origin feature/your-feature
  5. Open a Pull Request

License

This project is licensed under the MIT License. See the LICENSE file.


Support

For issues or feature requests, open an issue at:

👉 https://github.com/Le-Sourcier/create-nexlify.git