admin管理员组文章数量:1431420
I'd like to use some CommonJS
pliant 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.
I'd like to use some CommonJS
pliant 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.
Share Improve this question edited Sep 12, 2012 at 17:46 m09 asked Sep 1, 2012 at 8:29 m09m09 7,5213 gold badges33 silver badges61 bronze badges 6- 1 Is there a reason that node.js wouldn't work here? – Joe Commented Sep 6, 2012 at 16:59
- Well node.js does work here but I'd rather use the mongo shell and another way to include monJS modules – m09 Commented Sep 6, 2012 at 17:01
- Ah - your question didn't really mention using mongo shell as a requirement. – Joe Commented Sep 6, 2012 at 17:17
- well mongo shell is just an extended SpiderMonkey so a good general answer should fit – m09 Commented Sep 6, 2012 at 17:19
- There is a list on the monjs website. Several of these wrap SpiderMonkey. – Steve Campbell Commented Sep 7, 2012 at 21:09
1 Answer
Reset to default 10 +500@Mog
You should try out http://code.google./p/gpsee/ which is having general-purpose C API for embedding SpiderMonkey & CommonJS.
本文标签: javascriptMinimal CommonJS implementationStack Overflow
版权声明:本文标题:javascript - Minimal CommonJS implementation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745577611a2664427.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论