Reputation: 7493
I'd like to use some CommonJS
compliant modules in some of my scripts. Those scripts are just meant to do things on my laptop: it's not in the browser, it's not really in the server either. I just manipulate a mongodb
that I use locally.
So I wonder, what is the best way to do that? I only found outdated wrappers that would provide CommonJS capabilities and the mongo shell.
Should I handcode a require
system? Should I handcode a workaround? Is there already a minimal loader existing?
All your ideas regarding the matter will be appreciated, for sure.
Pointers towards implementation of other parts of CommonJS would be appreciated too.
Upvotes: 6
Views: 1088
Reputation: 1059
@Mog
You should try out http://code.google.com/p/gpsee/ which is having general-purpose C API for embedding SpiderMonkey & CommonJS.
Upvotes: 10