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

genrate

v0.0.11

Published

Create and build modern web applications with zero initial configuration

Downloads

25

Readme

Genrate

Genrate can help you quickly start modern web application project with a variety of built-in project templates.

Installation

Installing Genrate requires Node.js 14+, and either Yarn or npm.

npm i genrate -g

Getting Started

Run the following command to start the process. Substitute [directory-name] with the directory name you wish to create for this project.

gen use @tmplates/node [directory-name]

or

mkdir <directory-name>
cd <directory-name>
gen use @tmplates/node

The @tmplates/node above can be replaced with other project templates.

Project Templates

Depending on the type of project, genrate create different flavors of project structures and uses different compilation and testing suites.

The supported project type are:

| Project Type | Template Name | | ------------ | -------------------------------------------------------- | | Node | @tmplates/node | | Vanilla | @tmplates/vanilla | | Vue | @tmplates/vue | | React | @tmplates/react | | Electron | @tmplates/electron | | Nest | @tmplates/nest |

Commands

Below are the various genrate commands for manage locally template package.

| Command | Parameters | description | example | | -------- | ---------------------------------- | ------------------------------------------------ | ------------------------------------------ | | use | <Template Name> [directory-name] | initialize the project using the template | gen use @tmplates/vanilla [directory-name] | | init | [directory-name] | initialize the project using the custom template | gen init [directory-name] | | ls | / | list installed templates | gen ls | | outdated | / | check for outdated templates | gen outdated | | rm | <Template Name> | remove a template file | gen rm @tmplates/vanilla | | update | <Template Name> | update a template file | gen update @tmplates/vanilla |

Create Project Template

Genrate supports custom template packages, just create a template package project as agreement and publish it to npm.

A legal template package includes README.md, package.json and template entry file (etc: index.js template.js).

The template entry file needs to be specified in the package.json file using the template field, below is the added tempalte field schema:

"template": {
  "main": "index.js", // required
  "preprepare": "preprepare.js", // not required
  "postprepare": "postprepare.js" // not required
}
  • mian The main field specifies the template entry file. the file must export a JSON object or a function that returns JSON object and the JSON object must satisfy the template config definition.
  • preprepare It's a life cycle hook that is executed before parsing the main field, you can do something inside this hook and return a JSON object that matches the ProjectStruct definition.
  • postprepare It's a life cycle hook that is executed after parsing the main field, you can do something inside this hook and return a JSON object that matches the ProjectStruct definition.

For more examples, you can refer to Project Templates.

About Template Config Fields

{
  ts?: boolean // Whether to use ts language
  lib?: boolean // Whether to create a library project
  dirs?: Array<string> // Create some folders, etc: ['src', 'tests', 'plugins']
  files?: Array<Array<string>> // Create some files, etc: [['src/index.ts', ''], ['test/index.spce.js', '']]
  framework?: 'vanilla' | 'vue' | 'react' | 'electron' | 'nest' // Use a web framework, vanilla indicates that no framework is used
  fvs?: string // Select the framework version, you need to use with the framework field, currently supports Vue 2.x/3.x version
  lint?: Array<'stylelint' | 'eslint' | 'commitlint'> // Use lint tools, support stylelint, eslint and commitlint, Where stylelint used to unify code styles
  vscode?: Array<string> // Recommended of VScode plugins, need to fill in plugin ID, etc: ['vue.volar', 'mikestead.dotenv']
  test?: boolean // Whether to use unit tests
  e2e?: boolean // Whether to use End-to-End test solution
}

License

MIT.