require?

Oct 28, 2010 at 4:11 AM
Edited Oct 28, 2010 at 4:13 AM

Hi!

I am new in Javascript.Net and V8; Please help me: how to implement running such javascript code:

 

var mylib = require('some library');

I want to use external libraries like mongodb's javascript driver http://github.com/christkv/node-mongodb-native like this:

var Db = require('../lib/mongodb').Db;

Now i getting such error:

Unhandled Exception: Noesis.Javascript.JavascriptException: ReferenceError: require is not defined

Thank you for any advice!

 

Coordinator
Oct 28, 2010 at 3:24 PM

Please refer to the Quick Start documentation:

http://javascriptdotnet.codeplex.com/documentation

You can wrap any API in .NET and exposed any object instance part of that API to a Javascript.NET context. You can then run your scripts and use the exposed API from them.

Hope this helps.

The Noesis Team