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

genzo

v1.0.8

Published

Rapidly scaffold your projects for development with custom templates

Downloads

9

Readme

Features

  • Fetch your custom templates stored in GitHub or your local file system.
  • Fuzzy searches your list of templates for convenience and ease of use.
  • Interactive prompts using Inquirer to automate common tasks in repository setup.
  • Can detect a Monorepo template and install deps in all packages.
  • Checks the presence of Husky scripts and makes them executable so you don't have to!
  • Make use of slots to quickly replace repeated patterns in the generated repository.
  • Supports CLI arguments to automatically initialize Git, install packages and open your preferred code editor.

Motivation

As we gain experience with various projects and tools, we tend to maintain opinionated templates to bootstrap new projects. Maybe you have a customized setup for building a production-grade Web project, or you got some handy templates for experiments or even some for your technical interviews.

With genzo, you can rapidly scaffold projects using your custom templates from local and remote sources. It automates the most common tasks involved in setting up a JavaScript-based project.

If you find the tool useful, consider showing your support by giving a ⭐

Contributions are most welcome! We follow conventional-commits

Demo

  • Fetching templates from GitHub

general usage

  • Using a local Monorepo template and auto-setup git and packages without prompting the user with the -gi flag

monorepo usage

Templates created by me for reference - https://github.com/FatehAK/dev-templates

Installation

npm install -g genzo

Create a .genzorc.js file in your $HOME directory. Refer config for more details.

Usage

gen [OPTIONS] | genzo [OPTIONS]

OPTIONS:
  -h, --help             show this message and exit
  -v, --version          print the version string
  -g, --git              auto-initialize a git repository
  -i, --install          auto-install packages
  -e, --editor           opens the editor defined in config
  -e, --editor <string>  opens the specified editor

EXAMPLES:
  gen -g                 # auto-initializes a git repository without querying the user
  gen -i                 # auto-installs packages without querying the user
  gen -e                 # opens the generated repository in the editor defined in config
  gen -e code            # opens the generated repository in the specified editor (i.e VSCode)
  gen -gie               # does git init, installs packages and opens the editor defined in config
  gen -gi -e code        # does git init, installs packages and opens the specified editor (i.e VSCode)

Configuration

The configuration must be defined in .genzorc.js and placed in the system's $HOME directory.

An example configuration:

module.exports = {
  templatePath: 'https://api.github.com/repos/fatehak/dev-templates/contents/templates',
  githubToken: 'aNoiceToken',
  authorName: 'YOUR_NAME',
  slotPaths: ['**/.github/**', '**/package.json', '**/README.md'],
  slots: {
    '[SOME_VAR]': 'some_value',
  },
  editorBinary: 'code',
};

templatePath

Type: String Default: undefined

Accepts a GitHub repository path or an absolute path to the templates in your local system.

The GitHub repository path must in the format https://api.github.com/repos/${USER}/${REPO}/contents/path_to_templates

templatePath: 'https://api.github.com/repos/fatehak/dev-templates/contents/templates'

Or you can pass an absolute path to your templates stored locally

templatePath: '/Users/myuser/Dev/my-templates'

githubToken

Type: String Default: undefined

Optionally pass a GitHub token to avoid hitting GitHub's rate limiter. Only required if templatePath is a GitHub repository. It is mandatory to pass the token for private repositories.

Check this link for details on creating a token.

authorName

Type: String Default: undefined

The default author name to be used while creating the repository. If this value is present then the CLI will skip asking the author name query.

slotPaths

Type: Array[String] Default: []

An array of minimatch glob patterns that point to files with slots to replace.

slotPaths: ['**/.github/**', '**/package.json']

The above example will replace slots defined in .github folder and .package.json

slots

Type: Object Default: undefined

An object with slot name-value mapping. The CLI will replace these slots with their corresponding values within files.

slots: {
  '[AUTHOR_NAME]': 'your_name'
}

The above example will replace all occurences of [AUTHOR_NAME] with your_name in matching files defined in slotPaths

By default, [AUTHOR_NAME] and [REPO_NAME] slots will be replaced in the generated repository based on user input.

editorBinary

Type: String Default: undefined

Path to an editor binary. This will be used to optionally open the repository at the end of the genzo session.

editorBinary: '/Users/my_user/Library/Application Support/JetBrains/Toolbox/scripts/webstorm'

or you can also specify an alias to an editor binary, for example to open VSCode

editorBinary: 'code'

License

MIT