npmã§é ããã¦ãã©ã¤ãã©ãªã¨ãã©ããçºå±éä¸ã§ã°ãã°ãã ããã¬ã³ã¬ã³ç´ããã§ããã© git clone ã¨ããã¦ãããã¤ã以ä¸ã®ããã«ãããã¨ãã¦ããæã£ãããã« require ããã¦ãããªãã
cd HOGE NODE_PATH=lib node
var hoge = require('hoge');
以å npm install hoge ãã¦ãã£ãããã£ã¡ãèªã¾ãã¦ãã¾ãã
ãã®ãããã®æ©æ§ã¯ãã®ãã¼ã¸ããã£ããèªãã¨ã ããããããããã¼ã¸ä¸ã«æ¸ãã¦ããçä¼¼ã³ã¼ããããããããã
modules - Node.js v0.4.12 Manual & Documentation
ã§
NODE_PATH=lib ããä¸ã§requireæã« ./ ã¨ãã¤ããã°ããæãã«èªãã§ããããã ãã©ãnpmã§é
ãããã©ã¤ãã©ãªã®ãã¹ããã³ã¼ãä¾ã«ãããããã®ãæ··å
¥ãããã®ããããããªããã¨ã¯ããèªåã®æå
ã§ä¿®æ£ããã¨ãã« require('./hoge') ã¨ãã¦ããã¦commitæã«ã¯ require('hoge') ã«æ»ãã¨ã絶対ä¸å¯è½ã ãæ¼ããã
ã®ã§ããããã¾ãããã
cd HOGE ln -s lib node_modules
ãããã¦ããã° require('hoge') ã ã㧠lib/hoge ãããããnpmçµç±ã§å ¥ããã¢ã¸ã¥ã¼ã«ãããé«ãåªå 度ã§èªãã§ãããããã«ãªããããã§æ°è»½ã«gitã«ããnpmã¢ã¸ã¥ã¼ã«ãcloneãã¦åããã¦ãããæ¸ãã¦ãã¹ããã¦commitãã¦pushãã¦pullreqåºãããï¼
node_modules ãaddããªãããã«æ°ãã¤ãã¾ãããã