Skip to content

Commit

Permalink
Add usage for Node < 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxsoft committed May 2, 2016
1 parent 7da209b commit 31345f9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,26 @@ danmu-server
### 检查环境

#### Nodejs
必须安装[Nodejs](https://nodejs.org/)。支持``node 4.0``以上版本。

强烈推荐使用最新版本Nodejs(截至写文档时,最新稳定版为``5.5.4``)。

必须安装[Nodejs](https://nodejs.org/)。强烈推荐使用最新版本Nodejs。
##### 在Node 5.1+ / 6.x使用
无需任何附加操作,直接使用``npm start``就可以启动。

##### 在Node 4.x使用
你需要先用babel编译后才能使用。

首先,你需要安装babel-cli: ``npm install babel-cli -g``,接着进入本项目根目录下进行编译:
```bash
npm run install-babel
npm run compile
npm install
```

编译后,即可``npm start``启动。

##### 在Node 0.12使用

先按照Node 4.0的方法进行编译,编译后使用``npm run start-0.12``启动。

#### 数据库
如使用``csv``,可无视此节。

Expand Down
2 changes: 2 additions & 0 deletions app-0.12.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require("babel-polyfill");
require("./app");
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"version": "1.0.6-pre",
"license": "MIT",
"scripts": {
"start": "node app.js"
"start": "node app.js",
"start-0.12": "node app-0.12.js",
"install-babel": "npm install babel-preset-es2015 babel-preset-stage-0 babel-polyfill",
"compile": "babel ./lib/ --out-dir ./lib/ && babel app.js --out-dir ./"
},
"dependencies": {
"async": "^2.0.0-rc.3",
Expand Down Expand Up @@ -42,6 +45,12 @@
},
"homepage": "https://github.com/zsxsoft/danmu-server#readme",
"engines": {
"node": ">=4.0"
"node": ">=5.5"
},
"babel": {
"presets": [
"es2015",
"stage-0"
]
}
}

0 comments on commit 31345f9

Please sign in to comment.