# didi-command-init

> fis-didi scaffold

Latest version **0.1.3** (published 2016-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install didi-command-init
pnpm add didi-command-init
yarn add didi-command-init
bun add didi-command-init
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2016-08-17 |
| First published | 2015-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | webzhangnan |
| Maintainers | webzhangnan |
| Keywords | fis, scaffold, fis-didi |

## Links

- npm: https://www.npmjs.com/package/didi-command-init
- Repository: https://github.com/webzhangnan/didi-command-init
- Homepage: https://github.com/webzhangnan/didi-command-init.git
- Issues: https://github.com/webzhangnan/didi-command-init/issues
- npm.io page: https://npm.io/package/didi-command-init

## Dependencies (2)

- [prompt](https://npm.io/package/prompt.md) ^0.2.14
- [didi-component-install](https://npm.io/package/didi-component-install.md) ^0.2.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2016-08-17
- 0.1.2 — 2016-08-17
- 0.1.1 — 2016-08-17
- 0.1.0 — 2016-08-17
- 0.0.9 — 2015-09-12
- 0.0.8 — 2015-08-28
- 0.0.7 — 2015-08-26
- 0.0.6 — 2015-08-26
- 0.0.5 — 2015-08-26
- 0.0.4 — 2015-08-26
- 0.0.3 — 2015-08-25
- 0.0.2 — 2015-08-25
- 0.0.1 — 2015-08-23

## README

#[fis-didi](https://github.com/webzhangnan/fis-didi)脚手架

使用[fis-didi](https://github.com/webzhangnan/fis-didi)可以快速开始完成项目开发。

## 创建一个新项目

```bash
didi init project
```

在项目里默认有以下文件

```bash

├── component.json          // 目前主要作用记录项目使用了哪些模块（由此命令安装：didi install <namespace>/<component name>）
├── fis-conf.js             // fis-didi的配置文件
├── css			            // 项目的基础css文件
│   └── lib.css             // 基础HTML文件
├── img                     // 基础图片文件
│   └── didi.png
├── lib                     // 基础JS文件，主意里面文件都是 非模块化文件
│   ├── lib.js              // 负责将其他文件内嵌进来
│   ├── mod.js              // 模块加载器，配合fis-didi的发布来实现模块化
│   └── zepto.js            // 号称移动端的jquery
├── page                    // 页面根目录
│   └── pop                 // 示例页面文件夹
│       ├── animate.css     // 示例页面分出来的单个CSS
│       ├── main.css        // 示例页面的入口CSS
│       ├── main.html       // 示例页面的入口HTML
│       └── main.js
├── test                    // 模拟数据目录，特别注意的是其内部的结构和page文件夹一致
│   └── pop                 // 示例页面pop的模拟数据文件夹
│       └── main.php        // 示例页面pop的模拟数据
└── components              // 项目工程模块的跟目录
    ├── first               // first模块文件夹
    │   ├── first.css       // first模块的入口css，文件名须与模块名(first)相同 
    │   ├── first.html      // first模块的入口HTML，文件名须与模块名(first)相同
    │   └── first.js        // first模块的入口JS，文件名须与模块名(first)相同，可通过 require('first') 来获取模块
    ├── second
    │   ├── second.css
    │   ├── second.html
    │   └── second.js
    └── third
        ├── third.css
        ├── third.html
        └── third.js

```








## 创建一个新页面

```
cd <project_root>
```


```bash
didi init page
```

`<project_root>/page/<page_name>`文件夹下被创建，里面包含必要的几个文件。
`<project_root>/test/<page_name>/main.php`文件被创建，用来模拟php数据。


## 创建一个新模块

```bash
didi init component
```

`<project_root>/comonents/<component_name>/`文件夹下被创建，里面包含必要的几个文件。
其中`<project_root>/comonents/<component_name>/<component_name>.js`，
可以通过一下语法获取

```
require('<project_name>');
```

注：

- \<project_root\>：代表项目根目录
- \<page_root\>：代表项目名称
- \<component_name\>：代表模块名称

---
_Source: https://npm.io/package/didi-command-init · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
