Is it possible to use CommonJS libraries?

I am interested in starting with CommonJS .

With JavaScript frameworks running faster and parsers and compilers making JavaScript incredibly fast, it is surprising that a project such as CommonJS has not been launched before.

What are the steps involved in launching and launching a test project with what has been created so far?

+6
javascript commonjs
source share
5 answers

It really depends on what you really want to do. Persevere , for example, is a JSON database that is built on top of Rhino but is able to work with CommonJS modules and is created around JSGI (web server interface) in the future.

Narwhal is a fairly reliable JavaScript library and is specifically designed to track the CommonJS standard as it evolves. By default, Narwhal runs on top of Rhino, but you can also install JavaScriptCore (and possibly v8) as additional β€œengines”. AO is very fast.

Various web frameworks are available (including Helma NG ).

Node.js places great emphasis on fast event-based, network-based event-based network services based on JS events. Node has recently been modified to use CommonJS modules.

SproutCore has a branch ("ticks") that is built on CommonJS modules. I personally use this for Bespin , of which the client side is fully CommonJS modules. (Ironically, the server side is currently in Python, but we have plans to also switch to CommonJS on the server.)

What you need to remember about CommonJS is that it is an API specification. It can be many implementations. So far, the only part of the specification that is widely supported is the modules ... the rest is still baking, but is going well.

CommonJS has not yet reached the level of interoperability, say CPython / Jython / IronPython, but it certainly has this potential in the future.

+12
source share

What steps are being taken in a test project with has been created so far?

I found Narhwal quick launch the fastest way to start and run.

+2
source share

Have you tried running here ?

What are you stuck with?

+1
source share

He gels. You are early if you do not like living on the edge.

By the way, your wikipedia link has links to projects that use CommonJS. You had an answer before you came here.

+1
source share

I just started using Node.js at home. It works and seems great. The only problem I have encountered so far is that Windows support seems a bit distant.

I believe that Rhino works with Windows because it is a Javascript interpreter written in Java, but it also means that it is slower than Javascript-C implementations like V8. I don't think Rhino itself implements the CommonJS specification, but you can run something like Narwahl on top of it - as mentioned by Kevin and Jeff.

I just quickly installed Rhino, Ant (to create Rhino) and tried to get Narwhal to work with Windows, but was not successful.

I suggest trying Node.js on a Linux box, as it was my environment and it worked flawlessly.

0
source share

All Articles