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

@dking/hasaki-cli

v0.0.8

Published

自动化构建react, vue, jquery, js类库, koa/express/egg项目, node-plugin, typescript 等等多种项目结构初始化

Downloads

68

Readme

At present, the template project has not been fully developed, and will be added in succession。

hasaki-cli

It can automatically build React, Vue, jQuery, JS library, Koa / Express / Egg project, Plugin and other project structure initialization. It can also generate single or multiple plug-in configurations that can be used directly for existing projects.

Install

$ npm i @dking/hasaki-cli -g 

Usage

$ hasaki-cli init -d ./react-demo

$ hasaki-cli install https://github.com/JohnApache/hasaki-template/tree/master/react -d ./react-demo

$ hasaki-cli gen readme,eslint,babel,webpack --installed react

$ hasaki-cli template --list

CommandIntroduction

  • init | i Quickly initialize the project by selecting a suitable template. The optional configuration is as follows

    • -d, --out-dir Specifies the output directory, which is the current execution environment directory by default.
    • --ignore <pattern,...,parttern> Specify files to ignore.
    • --exclude <pattern,...,parttern> Specify files that do not require EJS rendering.
    • --include <pattern,...,parttern> Specifies the files that need to be rendered with EJS, generally used in conjunction with exclude.
    • -c, --config Specify the template project configuration file name to read, Default: .hasakirc.js.
    • -h, --help Output help documents
    $ hasaki-cli init -d ./react-demo
  • install It has the same effect as "init". The remote address is used instead of the built-in template option. The optional configuration is as follows

    • -d, --out-dir Specifies the output directory, which is the current execution environment directory by default.
    • --ignore <pattern,...,parttern> Specify files to ignore.
    • --exclude <pattern,...,parttern> Specify files that do not require EJS rendering.
    • --include <pattern,...,parttern> Specifies the files that need to be rendered with EJS, generally used in conjunction with exclude.
    • -c, --config Specify the template project configuration file name to read, Default: .hasakirc.js.
    • -h, --help Output help documents
    $ hasaki-cli init -d ./react-demo
  • template | t The command is used to customize the template list with CRUD. The optional configurations are as follows

    • --list Show current template list.
    • --add Add template.
    • --update Update template.
    • --delete Delete template.
    • --clear Clear template.
    • --reset Reset template.
    • -h, --help Output help documents
    $ hasaki-cli template --list
    
    $ hasaki-cli template --add
    
    $ hasaki-cli template --reset
  • gen | generate [plugin,...,plugin] Quickly add configuration files or other related files for existing projects

    • -d, --out-dir Specify output directory, default to current directory.
    • --installed <plugin,...,plugin> Specify the plug-in environment that the current project has installed.
    • -f, --force-cover Force overwrite file.
    • -h, --help Output help documents

    The list of supported plug-in configurations is as follows: readme, eslint, mocha, jest, babel, webpack, rollup, gulp, lerna, typescript.

    Additional configurable installed configuration: react, vue....

    $ hasaki-cli gen eslint,readme,mocha,babel,rollup,typepscript -d ./config --installed react

.hasakirc.js

.hasakirc.js file is a configuration file that exists in the root directory of the template project, hasaki-cli will attempt to dynamically read and load the file. And load the filter file according to the configuration file, read files according to ejs rules, If there is no such file, the target project will be output in full,Such a configuration file gives hasaki-cli the ability to customize template projects, allows users to customize template projects, output different contents in different situations, and it is applicable to any GitHub project, very flexible!.

// .hasakirc.js
module.exports = {
    parseExclude: [],
    parseInclude: [],
    ignore: [],
    question: [{
        type: 'confirm',
        message: 'use ts?',
        name: 'useTs',
        default: true
    }],
    screener(answers) {
        const { useTs } = answers;
        const include = [];
        const exclude = [];
    
        if(useTs) {
            exclude.push({
                path: './src/index.js'
            })
        }else {
            exclude.push({
                path: './src/index.ts'
            }, {
                path: './tsconfig.json'
            })
        }
        return { include, exclude }
    }
}
  • parseExclude

    • Meaning: Specify files that do not require EJS rendering, Prevent EJS template file in the project.
    • Type: Array<Rule | RegExp>
  • parseInclude

    • Meaning: Specify files that require EJS rendering,Use with parseExclude.
    • Type: Array<Rule | RegExp>
  • ignore

    • Meaning: Specify files to ignore
    • Type: Array<Rule | RegExp>
  • question

    • Meaning: Specify the interaction problem of [inquirer] (https://www.npmjs.com/package/inquirer) to be used
    • Type: Array For specific configuration, see inquirer.
  • screener

    • Meaning: Screener is a function, it takes "answer" of "question" as a parameter, return type is {exclude: Array<Rule | RegExp>, include: Array<Rule | RegExp>}, you can filter files according to different "answers".

    • Type: Function(answer: Answer): {

        exclude: Array<Rule | RegExp>; // Specify files to exclude
      
        include: Array<Rule | RegExp>; // Specifies the files to be included for use with "exclude"

      };

TIPS

  1. Multiple choices split multiple options with "," by default
  2. pattern can be a relative path of the target project or a RegExp, or a Rule, Rule is a object like this { path?: string; match?: RegExp; }, path is a relative path, match is RegExp, path and match only need one
  3. The .hasakirc.js file must be exported in commonjs.
  4. .hasakirc.js write question must same rules as inquirer Question. Otherwise, it will parse the error

Questions

Please open an issue here.

License

MIT