Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active May 17, 2017 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjunichi/5485822 to your computer and use it in GitHub Desktop.
Save kjunichi/5485822 to your computer and use it in GitHub Desktop.
Node.jsのメモ

node.jsを扱う上でのあれこれ

Webでの<script src="hoge.js"></script>を実装するには

eval(fs.readFileSync(__dirname+ '/hoge.js','utf8'));

環境変数にアクセスするには

process.env.HOME

JSONを読み込む

.jsonと拡張子を付けないと誤解される模様

var json=require('hoge.json');

JSONを書き出すには

var fs=require('fs');
var util = require('util');
fs.writeFileSync(filepath,util.format("%j",targetObj);

モジュール

node-image

FreeImageの一部のnode実装らしい

http-server

pythonのSimpleHttpServerの様にワンラインでhttpサーバーが上げられる。

デスクトップアプリ系

IDE系

プログラミング系

画像処理系

ネットワーク系

関連Gist

Link

アクセス解析タグ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment