Generate package by scaffold.

Usage no npm install needed!

<script type="module">
  import nuofeNdkGenerator from 'https://cdn.skypack.dev/@nuofe/ndk-generator';


NDK Generator

NPM version Downloads

Generate package by scaffold.


yarn add @nuofe/ndk-generator --dev


ndk-generator [--dist <distPath>] [--ignore <ignorePath[,ignorePath]>] [--scaffold <scaffoldPath>] [--scope <scope>] [--type <type>] [name]

First, add scripts in package.json, like this:

  "scripts": {
    "generate": "ndk-generator --dist ./packages"

Second, run command to generate project.

yarn generate


@nuofe/scaffolds is standard scaffold of app/web/component/library/tool/config/none. You can use --scaffold <scaffoldPath> [--type <type>] arguments to use other scaffolds, like this:

  "scripts": {
    "generate": "ndk-generator --scaffold ./scaffolds"

Scaffold base on mustache template system. The structure should be this:

|   |
|   \---[...scaffold files]

types.json content:

  "[type]": "[scaffold description]",

The scaffold files will transform by mustache.render(fileContent, view). The view will be this:

interface View: {
  type: string; // from types.json
  name: string; // name-value
  nAME: string; // nameValue
  Name: string; // NameValue
  NAME: string; // NAME_VALUE
  scope: string;
  description: string;
  author: string;
  command: string; // for tool
  keywords: string[];
  title: string;