Skip to content

Instantly share code, notes, and snippets.

@jackfranklin
Created November 21, 2012 13:45
Show Gist options
  • Save jackfranklin/4124906 to your computer and use it in GitHub Desktop.
Save jackfranklin/4124906 to your computer and use it in GitHub Desktop.
What to look for when choosing a JS Plugin / Widget / etc

Is it on Github?

Maybe this is incredibly unfair of me, but I immediately discount any plugins that only let you download via a zip. There's no excuse for it not to be on Github, completely in the open.

Is it active?

If the last commit in the repository was more than 6 months or so ago, there's a decent change it's out of date, but I still might take a quick look. Any repository not updated in 12 months is immediately discarded.

Does it have tests (and are they well written)?

Once again, no real excuse not to test code with JS these days. There's a plethora of libraries and resources available. Tests let me know with confidence that this plugin does do what it says it does. No tests = discarded, with the slight exception of some plugins or polyfills. For example, this Full Screen polyfil by Sindre is an example of a library without tests, that I'd be happy to use.

Is there good documentation, or at the very least a working demo?

It's part of your responsibility as a developer to document your libraries properly. Ideally, you'd provide a working demo and full documentation, but at the very least I expect a demo. The more complex the plugin, the less slack I give you. I shouldn't have to be diving into the source to find out how to use it.

Is browser support documented?

If it's not, don't assume that means it works fully. In a time when some of us are lucky enough to not worry about older browsers, but some of us are, often libraries have differing ideas on browser support. There's nothing wrong with that, but it should be documented.

Is Accessibility documented?

Does it support keyboard usage, or document how accessible (or not) the plugin is? (Good one @JamieKnight).

Does it use a build tool?

Not a must-have, but a nice-have. If I want to make changes or edit it, being able to run tests and minify, etc through a command line tool like Grunt is really useful.

Is the file/folder structure well organised?

I don't want everything in the root. Put other assets (other libs, CSS) into its own folder, put your tests in its own folder and so on. Be tidy!

jQuery Plugin Specifics

  • is it a jQuery plugin that doesn't touch the DOM? If so, avoid (thanks @sindresorhus).
@JamieKnight
Copy link

Hiya Jack,

Just to add, i also look to make sure it mentions accessibility or keyboard function somewhere!

Cheers,

Jamie + Lion

@sindresorhus
Copy link

Is it a jQuery plugin that doesn't touch the DOM? - run for the hills

@jackfranklin
Copy link
Author

Both awesome shouts, thanks!

Planning to turn this into a blog post too, so any feedback or suggestions are much appreciated.

@chrisgraham
Copy link

All very good points. Would love you to end your blog post with something like "And, if you find a library that matches all of this, the author must have worked hard - please donate to them to support development, and build the cost of those donations into your projects if you are charging to a client.". That'd make it fair, it's got to be a two-way street, even with Open Source - developer works hard to make something for free, but users must then support the developer in a capitalist world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment