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 🙏

© 2026 – Pkg Stats / Ryan Hefner

asycli

v1.0.5

Published

CLI tool to generate TypeScript module files

Readme

AsyCLI

A CLI tool for generating TypeScript module files with NestJS, React, and React Native structure.

Features

  • Generate complete module structure with a single command
  • Support for multiple frameworks:
    • NestJS: Creates module structure with:
      • [module].service.ts
      • [module].repository.ts
      • [module].resolver.ts
      • [module].schema.ts
      • [module].dto.ts
      • [module].module.ts
    • React: Creates various React components and structures:
      • Pages: [page].tsx (with routing and layout)
      • Screens: [screen].tsx (for screen components)
      • Components:
        • Table components
        • Create form components
      • Context: [context].tsx (for state management)
      • Models: [model].ts (for TypeScript interfaces)
      • GraphQL:
        • Queries
        • Fragments
  • Pre-populated with framework-specific decorators and basic structure
  • Template-based system for easy customization

Installation

Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)

Global Installation

  1. Clone the repository:
git clone https://github.com/yourusername/asycli.git
cd asycli
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Install globally:
npm install -g .

Local Installation

  1. Clone the repository:
git clone https://github.com/yourusername/asycli.git
cd asycli
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Usage

Basic Usage

asycli generate -d ./src -m user

This will create a user directory with all the necessary files in the src directory.

Options

  • -d, --dir <directory>: Target directory for generated files (required)
  • -m, --module <name>: Name of the module to generate (required)

Example

asycli generate -d ./src -m user

This will create the following structure:

src/
└── user/
    ├── user.service.ts
    ├── user.repository.ts
    ├── user.resolver.ts
    ├── user.schema.ts
    ├── user.dto.ts
    └── user.module.ts

Examples

NestJS Example

asycli generate -d ./src -m user -f nest

This will create the following structure:

src/
└── user/
    ├── user.service.ts
    ├── user.repository.ts
    ├── user.resolver.ts
    ├── user.schema.ts
    ├── user.dto.ts
    └── user.module.ts

Development

Building the Project

The build process includes:

  1. Cleaning the dist directory
  2. Compiling TypeScript files
  3. Copying template files to dist directory
npm run build

Running in Development Mode

npm run dev

Testing the CLI

npm run dev -- -d ./src -m test

Available Scripts

  • npm run clean: Remove the dist directory
  • npm run copy-templates: Copy template files to dist directory
  • npm run build: Full build process
  • npm run start: Run the compiled version
  • npm run dev: Run in development mode with ts-node
  • npm run prepare: Run before npm install (automatically builds the project)

Project Structure

.
├── bin/
│   └── asycli              # CLI entry point
├── src/
│   ├── templates/          # Template files
│   │   ├── nest/          # NestJS templates
│   │   │   ├── service.template.txt
│   │   │   ├── repository.template.txt
│   │   │   ├── resolver.template.txt
│   │   │   ├── schema.template.txt
│   │   │   ├── dto.template.txt
│   │   │   └── module.template.txt
│   │   ├── react/         # React templates
│   │   │   ├── page.template.tsx.txt
│   │   │   ├── screen.template.tsx.txt
│   │   │   ├── context.template.tsx.txt
│   │   │   ├── model.template.ts.txt
│   │   │   ├── components/
│   │   │   │   ├── table.template.tsx.txt
│   │   │   │   └── create.template.tsx.txt
│   │   │   └── gql/
│   │   │       ├── query.template.ts.txt
│   │   │       └── fragment.template.ts.txt
│   │   └── react-native/  # React Native templates
│   │       ├── component.template.txt
│   │       ├── styles.template.txt
│   │       ├── test.template.txt
│   │       └── types.template.txt
│   └── index.ts            # Main CLI logic
├── dist/                   # Compiled JavaScript files
├── package.json
└── tsconfig.json

Dependencies

  • @nestjs/common: For NestJS decorators and utilities
  • @nestjs/graphql: For GraphQL support
  • commander: For CLI argument parsing
  • typescript: For TypeScript compilation

License

ISC