GPL is the best opensource license. But seeing this as a library, it might need to be LGPL rather than pure GPL (ala, you can use it as a library without "tainting" your source, but if you make modifications to the library, you must release it).
May be, but AGPL is intended for server based apps, rather than local apps (which i presume this library is intended, but i suppose the javascript part can be considered to fall into the server category).