Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including create-doddle with all npm packages installed. Try it out:

var createDoddle = require("create-doddle")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

create-doddle v1.3.1

a project scaffolding

create-doddle

一个简易的脚手架,一键创建一个简易的 react 项目; 使用了 ES7 语法,且未编译,所以 node 版本为 8 最好

操作指南

// 全局化安装引用
npm install create-doddle -g

create-doddle [options] templateType projectName
// 使用npx引用
npx create-doddle [options] templateType projectName

templateType(模板类型),有四种模板可选:

  • react 入门级 react 模板
  • dva dva 模板
  • antd 中后台项目模板
  • vue (暂无)
  • h5 (暂无)

projectName(项目名称),基于当前命令执行路径,并将模板拷贝到这个项目文件夹下

options(可选参数):

  • -f: 强制删除当前命令执行路径下已存在的 projectName 文件夹;
  • -h:帮助,commander 原生提供

原理介绍

文章:前端脚手架,听起来玄乎,实际呢?

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free