ChangeLog を書く際によく使われる英語をまとめました。
ほとんど引用です。
function Window() { | |
.... | |
} | |
Window.prototype.build = function () { | |
this.setWidet(); | |
} | |
Wondow.prototype.setWidget = function () { | |
this.root.add(this.widget.tabMenue); |
npm start
コマンドを実行すると、 package.json の script.start コマンドが実行される
"scripts": {
"start": "NODE_ENV=production NODE_PATH=lib node --harmony_typeof --harmony"
}
http://d.hatena.ne.jp/Jxck/20120410/1334071898 Node.js の起動オプション、環境変数、npm start の話
var path = require('path') | |
, mode = process.env.NODE_ENV || 'development' | |
, env = require(path.resolve('resources/environments', mode)) | |
; | |
console.log(env.WHOAMI); | |
// output: dev太郎 |
var http = require("http") | |
, server | |
; | |
server = http.createServer(function (req, res) { | |
res.writeHead(200); | |
res.end("<html><body><p>hi i am hidakaya</p></body></html>"); | |
}); | |
module.exports = server; |
var http = require('http') | |
, connect = require('connect') | |
, app | |
; | |
app = connect() | |
.use(assetsExpire(1000 * 60 * 3)) | |
.use(connect.static('public')) | |
.use(function(req, res){ | |
res.end(' \ |
var fs = require('fs'), | |
path = require('path'); | |
(function scan(dir) { | |
fs.readdirSync(dir).forEach(function (item) { | |
var stat = fs.statSync(path.join(dir, item)); | |
if (stat.isFile()) require(path.join(dir, item)); | |
else if (stat.isDirectory()) scan(path.join(dir, item)); | |
}); | |
})('./lib/some/dir'); |
<html> | |
<head> | |
<style type="text/css"> | |
div { | |
width: 600px; | |
height: 50px; | |
} | |
.blue { background-color: blue; } | |
.green { background-color: green; } |