views:

370

answers:

6

Many languages have standard repositories where people donate useful libraries that they want others to have access to. For instance Perl has CPAN, PHP has PEAR, Ruby has RubyGems, and so on. What is the best option for JavaScript?

I ask because a few months ago I ported Statistics::Distributions from Perl to JavaScript. (When I say ported I mean, "Ran text substitutions, fixed a few things by hand." I did not rewrite it.) Since I've used this module a number of times in Perl, I figure that statistics-distributions.js is likely to be useful to someone. So I've put it under the same open source license as the original (your choice of the GPL or the Artistic License). But I have no idea where to put it so that people who might want it are likely to find it.

It doesn't fit into any sort of framework. It is just a standalone library that gives you the ability to calculate a number of useful statistics distributions to 5 digits of accuracy. In JavaScript.

A: 

You could start a project on SourceForge to contain useful snippets of code like this (or google for snippets to find one).

paxdiablo
+3  A: 

There is no centralized repository for JavaScript. JS Libraries usually have their own plugin-repositories, but for stand-alone scripts, The best way to promote it is to send it to famous website such as ajaxian or mashable

gizmo
My problem with promoting it that way is that I would be drawing attention to it for people who don't want it, and people who do in 6 months still can't find it.Even if there is no centralized repository, is there any reasonably popular and searchable one?
Well, this sites have tags and well organized archives. I often do a search within when I'm looking for some JS stuff.
gizmo
+1  A: 

AFAIK, there is no central JavaScript repository, but you might have success promoting it on Snipplr or as a project on Google Code.

Andrew Hedges
I chose Google Code because I thought it more likely that someone searching for something like this would find it there than anywhere else. See http://code.google.com/p/statistics-distributions-js/ for the project.
+1  A: 

Perl, Ruby, PHP, etc all have distribution mechanisms built into the language to consume such libraries.

There's not such a thing built into JS.

There are tons of script archives out there - but no "central" JS repo.

Subimage
+3  A: 

JSAN (JavaScript Archive Network) sounds like the kind of thing you're looking for, but I've never personally used anything from it apart from Test.Builder.

As long as your JavaScript can be dropped in to people's projects without polluting the global namespace or doing things which are liable to cause breakage in other people's code (adding to Object.prototype, for example) I would just stick it somewhere like Google Code as already suggested.

insin
That was my original thought, but JSAN is a dead project at this point.
Yeah, I didn't know JSAN was dead (shows you how often I used it), but it is as dead as a doornail. That's too bad, I think that would've been nice to have.
Jason Bunting
+1  A: 

Consider packaging it up as a plugin for one of the major Javascript libraries such as jQuery - see http://docs.jquery.com/Plugins/Authoring for more details. This way it can be included on their plugin page which will get it good exposure as they have a huge developer base and it'll be one of their first ports of call when a need arises for such functionality.

Whilst jQuery is one of the most popular frameworks (if not the most) out there, there are a host if other libraries you could consider using in addition to/instead of it.

Luke Bennett