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

corep-cli

v0.2.6

Published

A versatile command-line tool designed to streamline the creation of web development projects by generating structured templates for backend and frontend. Supports dynamic CRUD generation, page structures, and theme customization.

Downloads

511

Readme

core-cli

core-cli is a command-line tool designed to accelerate the creation of web development projects by simplifying the generation of project structures for both backend and frontend. This tool allows developers to quickly generate CRUD models for backend applications and create various pages and structures for frontend projects, including support for light and dark themes.

Installation

To install core-cli globally on your system, run the following command:

npm install -g corep-cli

This command allows you to access core-cli from anywhere in your terminal.

Configuring .core-config

core-cli uses a .core-config file to manage project settings automatically. This file can be created by running:

core-cli --init

Or using the shorthand:

core-cli -i

Example .core-config for Backend Projects

{
  "nameProject": "my-backend-project",
  "version": "1.0.0",
  "platform": "backend",
  "connectionConfig": "unit-connection"
}

Example .core-config for Frontend Projects

{
  "nameProject": "my-frontend-project",
  "version": "1.0.0",
  "platform": "frontend"
}

Key Fields in .core-config:

  • nameProject: The name of the project used in various operations.
  • version: The current version of the project.
  • platform: Defines whether the project is for backend or frontend.
  • connectionConfig: For backend projects, this field determines the database connection type. It can be global-connection or unit-connection.

How .core-config Works:

If the .core-config file is present in the project root, core-cli will automatically use the settings specified within it. For example, when running the command:

core-cli --create crud-v4 --directory src/core --name product

If the --platform option is not provided, core-cli will default to the platform specified in the .core-config file. However, if the --platform option is passed, it will override the value in the .core-config.

Usage

Command Structure

core-cli can be invoked using the following aliases: core, core-cli, or cr. Below are the available options and how to use them:

Options Overview

  • Platform [--platform | -p]: Specify the target platform for your project. Accepted values include:

    • Backend: backend, back, b
    • Frontend: frontend, front, f
  • Template [--create | -c]: This is a required option that specifies the type of template you want to create. Accepted values include:

    • For backend:
      • crud-v4: Generates a complete CRUD model with functionalities to create, update, delete, export to Excel, and pagination. Routes are automatically configured in the API.
    • For frontend:
      • page: Creates a basic page structure following the project conventions.
      • single-forms: Creates pages for managing single forms.
      • page-v4-tool: An enhanced implementation including a modern layout, full CRUD support, and a theme selector (light and dark).
  • Directory [--directory | -d]: Specify the target directory for the template copy. If a --name is not provided, the last segment of the directory path will be used as the name.

  • Name [--name | -n]: Define the name for the copied template. If no directory is specified, a new folder with this name will be created in the current working directory to store the files.

Examples

  1. Creating a backend CRUD with a specific name:

    core -c crud-v4 -n brand
  2. Specifying a directory for the template:

    cr --create crud-v4 -d src/core/category
  3. Full configuration, specifying platform, template, directory, and name:

    core-cli --platform backend --create crud-v4 --directory src/core --name product

Error Handling & Messages

  • If a target directory already exists with the same name, core-cli will display an error and stop execution.
  • When templates are successfully generated, the tool displays a list of created files along with success messages.
  • The tool also checks for the existence of a “base” directory. If not found, an error message is shown.

License

This project is licensed under the “Commons Clause”. For more details, refer to the LICENSE.md file in the project repository.