150 likes | 377 Views
Narwhal. 2009/07/28 Open INTRA-MART 榎本 潤. ServerJS. Server Side JavaScript API の標準化 ServerJS group (Google group) http://groups.google.com/group/serverjs IRC Freenode #serverjs. args base16 base64 crc32 file hash http io logger. md4 md5 mime os packages promise regexp
E N D
Narwhal 2009/07/28Open INTRA-MART榎本 潤
ServerJS • Server Side JavaScript APIの標準化 • ServerJS group (Google group) • http://groups.google.com/group/serverjs • IRC • Freenode • #serverjs
args base16 base64 crc32 file hash http io logger md4 md5 mime os packages promise regexp sandbox sha API
ex: file var File = require(‘file’); // read file. var content = File.read(‘./foo.txt’); // write file File.write(‘./bar.txt’, content);
ex: http var Http = require(‘http’); var content = Http.read(‘http://www.google.com’); // globalScope::system system.stdout.writeln(content.toString(‘UTF-8’));
ex: base64 var Base64 = require(‘base64’); var content = Base64.encode(‘hello ServerJS’); system.stdout.writeln(content);
Narwhal • ServerJS実装 • 実行エンジン: Rhino • 独自ライセンス • http://narwhaljs.org/
Narwhal • サブパッケージ • Jack • Webアプリ用モジュール • Chiron • 汎用的なモジュール群 • Nitro • Jackを利用したWebApplication Framework • getjs • Package Manager
いつもの事ながら im-jssp frameworkで うごかしまーす
やった事 jssp-config.properties( or xml ) Initializer4Script=narwhal/platforms/rhino/bootstrap
やった事 bootstrap.js global = Packages.org.intra_mart.jssp.script.FoundationScriptScope.instance(); var NARWHAL_HOME = Packages.org.intra_mart.jssp.util.config.HomeDirectory.instance() + "/WEB-INF/jssp/narwhal";