I tried different tool for writing javascript code such as netBeam and eclipse.
They are great tool for developing javascript library but they have the disadvantages to rely on java which is not very fast at all for my laptop (1GB of memory and 1.1Ghz CPU).
Can you please suggest me an open source tool to help developers writing JavaScript libraries?
You have tons of options.
A javascript library is just a regular piece of code. Try several, and pick whichever one you like best.
For the debugging part, the two major browsers (talking about actual browsers, not IE) Chrome and FireFox both have great debugging tools. Chrome has the built in Developer Tools (Ctrl-Shift-I to launch) and ff has FireBug.