銀の光と碧い空

クラウドなインフラとC#なアプリ開発の狭間にいるエンジニアの日々

Azure Mobile Services の Node.js のバージョンその他の情報を調べてみた

Azure Mobile Services のスクリプトでWeb APIをたたいてXMLをパースする - 銀の光と碧い空 という記事の中で、Mobile ServiceのスクリプトはNode.jsで記述する、と書きました。では、そのバージョンはいくらなのでしょうか?Node.jsはまだまだバージョンによってAPIの変更があります。バージョンがわかっていたほうがスクリプトの記述に役立つでしょう。

こんなスクリプトを書いて実行していみます。

function samplejob() {
    var os = require('os');
    console.info('hostname: %s', os.hostname());
    console.info('type: %s', os.type());
    console.info('platform: %s', os.platform());
    console.info('arch: %s', os.arch());
    console.info('release: %s', os.release());
    console.info('cpus: %j', os.cpus());
    console.log('execPath: %s', process.execPath);
    console.log('execArgv: %s', process.execArgv);
    console.log('versions: %j', process.versions);
    console.log('config: %j', process.config);
}

実行してみた結果はこうなりました。(見やすいように、JSON部分は整形)

hostname: RD00155D381464 type: Windows_NT platform: win32 arch: ia32 release: 6.2.9200 cpus: [ { "model": "Quad-Core AMD Opteron(tm) Processor 2373 EE", "speed": 2100, "times": { "idle": 1368914390, "irq": 220453, "nice": 0, "sys": 19667828, "user": 36351812 } }, { "model": "Quad-Core AMD Opteron(tm) Processor 2373 EE", "speed": 2100, "times": { "idle": 1400346328, "irq": 239765, "nice": 0, "sys": 11683875, "user": 12903437 } }, { "model": "Quad-Core AMD Opteron(tm) Processor 2373 EE", "speed": 2100, "times": { "idle": 1422222359, "irq": 19593, "nice": 0, "sys": 961609, "user": 1749671 } }, { "model": "Quad-Core AMD Opteron(tm) Processor 2373 EE", "speed": 2100, "times": { "idle": 1423905375, "irq": 7703, "nice": 0, "sys": 375171, "user": 653093 } }, { "model": "Quad-Core AMD Opteron(tm) Processor 2373 EE", "speed": 2100, "times": { "idle": 1389330890, "irq": 196062, "nice": 0, "sys": 14794265, "user": 20808484 } }, { "model": "Quad-Core AMD Opteron(tm) Processor 2373 EE", "speed": 2100, "times": { "idle": 1410532312, "irq": 79671, "nice": 0, "sys": 4565578, "user": 9835750 } }, { "model": "Quad-Core AMD Opteron(tm) Processor 2373 EE", "speed": 2100, "times": { "idle": 1423316765, "irq": 18406, "nice": 0, "sys": 604984, "user": 1011812 } }, { "model": "Quad-Core AMD Opteron(tm) Processor 2373 EE", "speed": 2100, "times": { "idle": 1424434890, "irq": 5437, "nice": 0, "sys": 170359, "user": 328296 } } ] execPath: D:\Program Files (x86)\nodejs\0.8.19\node.exe execArgv: versions: { "ares": "1.7.5-DEV", "http_parser": "1.0", "node": "0.8.19", "openssl": "1.0.0f", "uv": "0.8", "v8": "3.11.10.25", "zlib": "1.2.3" } config: { "target_defaults": { "cflags": , "default_configuration": "Release", "defines": , "include_dirs": , "libraries": }, "variables": { "clang": 0, "host_arch": "ia32", "node_install_npm": true, "node_install_waf": true, "node_prefix": "", "node_shared_openssl": false, "node_shared_v8": false, "node_shared_zlib": false, "node_tag": "", "node_unsafe_optimizations": 0, "node_use_dtrace": false, "node_use_etw": true, "node_use_openssl": true, "target_arch": "ia32", "v8_no_strict_aliasing": 1, "v8_use_snapshot": false, "visibility": "" } }

Node.js のバージョンは0.8.19でした。最新の0.10系でもなく、0.8系の最新でもないようです。そのほかさまざまな情報が取得できました。 osやprocessへのアクセスに制限がかかっているわけでもなく、普通に公開されているNode.jsのバイナリを使っていそうです。

公開されている情報ではないので、いつバージョンアップされるかすらわかりませんが、ひとまずMobile Servicesで使うNode.jsのAPIについて調べたいときは 0.8(.19) について調べるとよさそうです。