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

cli-for-frameworks

v1.0.4

Published

CLI tool to generate components, pages, services, routes for multiple frameworks

Downloads

18

Readme

Dưới đây là phiên bản cập nhật của README với tên CLI là cli-for-framework.

# CLI for Framework

`cli-for-framework` là một công cụ dòng lệnh mạnh mẽ giúp bạn nhanh chóng tạo các component, controller, service, và các file khác cho nhiều framework khác nhau như React, Next.js, Vue, NestJS, Express, v.v.

## Tính năng

- Tạo nhanh các component cho **React**, **Next.js**, **Vue**, **NestJS**, **Express**, **HTML**, **Dart**, **Flutter**, **React Native**.
- Hỗ trợ tạo các file như **controller**, **service**, **DTO** cho **NestJS**, **Express**, **HTML**, **Dart**, **Flutter**, **React Native**.
- Tạo folder và file mới theo cú pháp định dạng dễ dàng.
- Xóa hoặc thay thế các file hiện tại.

## Cài đặt

Để cài đặt công cụ `cli-for-framework`, hãy sử dụng npm hoặc yarn.

Khi bạn đã đẩy package lên npm và cấu hình file `package.json` như trên, để sử dụng công cụ CLI mà bạn đã tạo ra (`js-code-gen-cli`), bạn cần thực hiện theo các bước sau:

### 1. Cài đặt công cụ CLI

Để cài đặt công cụ CLI của bạn, người dùng có thể sử dụng npm hoặc yarn.

- **Cài đặt thông qua npm:**

```bash
npm i -g cli-for-frameworks
  • Cài đặt thông qua yarn:
yarn global add cli-for-frameworks

Công cụ CLI này sẽ được cài đặt trên toàn bộ hệ thống và có thể sử dụng từ bất kỳ đâu trong terminal.

2. Sử dụng công cụ CLI

Sau khi cài đặt, người dùng có thể sử dụng CLI thông qua lệnh code-g (tên lệnh bạn đã định nghĩa trong bin của package.json).

Cú pháp sử dụng CLI:

code-g <action> <component-name> --framework <framework> --path <optional-path>

3. Các Lệnh Chính

Dưới đây là một số ví dụ về các lệnh mà người dùng có thể sử dụng:

Tạo Component

Ví dụ để tạo một React component có tên là Card trong thư mục components:

code-g generate(g) Card --framework React --path components

Kết quả sẽ tạo ra cấu trúc như sau:

components/
  Card/
    Card.tsx

Tạo Page cho Next.js

Ví dụ tạo một Next.js page có tên là Home trong thư mục pages:

code-g generate(g) Home --framework Next.js --path pages

Kết quả sẽ tạo ra cấu trúc như sau:

pages/
  Home/
    Home.tsx

Xóa File

Ví dụ xóa file components/Button/Button.tsx:

code-g delete(d) components/Button/Button.tsx

Thay thế File

Ví dụ thay thế file components/Card/Card.tsx:

code-g replace(r) components/Card/Card.tsx

4. Xem Hướng Dẫn Sử Dụng

Nếu người dùng muốn xem hướng dẫn sử dụng lệnh, họ có thể chạy:

code-g --help

Điều này sẽ hiển thị tất cả các lệnh có sẵn và cú pháp cho từng lệnh.

Tổng kết

Sau khi người dùng cài đặt công cụ thông qua npm hoặc yarn, họ có thể sử dụng lệnh code-g để tạo các component, page, service, controller, và các file khác cho các framework như React, Next.js, Vue, NestJS,Dark, Flutter, React-Native và Express. Họ cũng có thể xóa hoặc thay thế các file đã có bằng cách sử dụng các lệnh tương ứng.