I built for a hml5 gameserver.
--sourcemap --module commonjs --target ES5
- specify file or folder:
- mocha *.js
- mocha test/
- use istanbul
- istanbul cover [file]
- istanbul cover _mocha -- -R spec
- node --trace_gc --trace_gc_verbose app.js
- will log gc info when starts
- node --max-old-space-size=4096 app.js
- will log gc info when starts
- npm install
will install dependencies and devDependencies
- npm install --production
will not install modules listed in devDependencies
- node_modules/protobufjs/bin/pbjs src/share/cmd.proto -target=commonjs > src/share/cmd.js
will generate server used file
- node_modules/protobufjs/bin/pbjs src/share/cmd.proto -target=json > src/share/cmd.json
will generate client used file
- parse_cmd.js
will parse src/share/cmd.proto for client and svn ci
- parse_db.js
will parse src/share/db.proto for server
- npm install grunt-cli -g
is dependence
- grunt-ts
is a npm, help to compile ts to js
- gruntfile.js
all grunt job config here
- grunt ts
is command line exec within three/, and will auto compile ts to js. If missing the param 'ts', will default compile ts to js
doesn't help to clear the folder, which means if you delete some *.ts, it will auto remove the *.js or *.js.map in /bin
write your reserved vars and props to uglify-reserved.json file.
- npm install tsd -g
is dependence
- tsd init
is command line to init tsd support
- tsd install async -s
is command line exec within three/, will install async.d.ts and save to typing.d.ts and tsd.json which will help to code
- tsd update -s -o
update tsd file and overwrite
npm install pm2 -g
Listing all running processes:
$ pm2 listManaging your processes is straightforward:
$ pm2 stop <app_name|id|all>
$ pm2 restart <app_name|id|all>
$ pm2 delete <app_name|id|all>To have more details on a specific process:
$ pm2 describe 0Monitoring all processes launched:
$ pm2 monitDisplaying logs of a specified process or all processes, in real time:
$ pm2 logs
$ pm2 logs --raw
$ pm2 logs big-api
$ pm2 flush # Clear all the logswrite c++ addons within addons folder
$ sudo npm install node-gyp -g
$ cd [your_path]
$ node-gyp configure
$ node-gyp build