Howdy.
I'm building support for running JavaScript-based applications and
middleware on top of the NRack[1] framework. I recently moved from
Jurassic to IronJS, specifically for the Mono support and the latest
benchmarks claiming IronJS is faster.
Currently, I'm using CommonJS to handle JavaScript module referencing.
The starting point for an app running on this framework is a config.js
file. Inside this config file, I reference functions to chain
middleware and applications (map, use, run). As a temporary hack, I'm
putting these functions on the global object.
Here's what I'd like to do...
I'd like to define my map, use, and run functions inside a
CommonObject in C#. I'd like to yank the source from the config.js
file and add that to the scope of the CommonObject for execution.
This is really due to an API decision. I'd like my config.js file to
look something like...
// config.js
var helloWorld = require("./helloWorld"),
methodOverride = require("./methodOverride");
use(methodOverride);
run(helloWorld);
//-------------------------
Is there a way to accomplish this in IronJS with the current release?
Thanks!
[1] A port of Ruby's Rack framework to C#,
https://github.com/kevinswiber/NRack/