Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimal CommonJS implementation

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.

like image 809
m09 Avatar asked Sep 01 '12 08:09

m09


1 Answers

@Mog

You should try out http://code.google.com/p/gpsee/ which is having general-purpose C API for embedding SpiderMonkey & CommonJS.

like image 169
Simone Rossaini Avatar answered Sep 28 '22 00:09

Simone Rossaini