Minimal CommonJS implementation

I would like to use some CommonJS compatible modules in some of my scripts. These scripts are intended only to do something on my laptop: it is not in the browser, it is also not on the server. I just manipulate mongodb , which I use locally.

So, I wonder what is the best way to do this? I just found outdated shells that provided CommonJS features and a mongo shell.

Do I have to code the require system manually? Do I have to manually specify a workaround? Is there already a minimal bootloader?

All your ideas on this will be appreciated, of course.

Pointers to implement other parts of CommonJS will also be appreciated.

+6
source share
1 answer

@Mog

You should try http://code.google.com/p/gpsee/ which has a general purpose C API for embedding SpiderMonkey and CommonJS.

+10
source

Source: https://habr.com/ru/post/924334/


All Articles