Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am developing a free, open-source (duh) JavaScript library, and wondering how to license it.

I was considering the GNU GPL, but I heard that I must distribute the license with the software, and I'm not sure anymore.

I would like the library to be available much like jQuery: In a free, downloadable script, preferably in either original or minified form. Am I mistaken about the GNU GPL license terms? jQuery is dual licensed under GNU GPL or MIT licenses.

How does the GPL apply to single script files like that? Can I license my library with nothing more than a few sentences in the script file? Is there another license that better suits my needs?

What would be nice is a license that allows you to put the URL in the source, for people to read if they want. I don't know that many do, unless I am mistaken.

I am generally looking to release the library as free software like the GPL specifies, but don't want to have to force licensees to download the full license unless they wish to read it.

share|improve this question
1  
WTFPL –  Zirak Jun 27 '12 at 13:14
2  
@Zirak: The profane version of 'public domain'? –  Kendall Frey Jun 27 '12 at 13:16
    
That depends. Do you want people to be able to redistribute a modified version of it with closed source or with other license (in this case, you use BSD License or MIT), or do you want it to be irrevocably open source (in this case, use GPL or LGPL)? –  YuriAlbuquerque Jun 27 '12 at 13:16
    
For one thing, I don't understand how a JavaScript library can be closed-source, except with obfuscation. I do want author credit in all versions the script, much like under GPL. –  Kendall Frey Jun 27 '12 at 13:22
    
@KendallFrey PD is a lie. Varies from country to country and from law to law. WTFPL is the closest thing to truly unbound you can find (or at least that I can find.) –  Zirak Jun 27 '12 at 13:22
show 8 more comments

4 Answers

up vote 4 down vote accepted

Keep it Simple

Use the MIT/X11 License.

  • open and permissible,
  • no-brainer / simple,
  • allows both free and commercial re-use,
  • short,
  • clearly gives you copyright,
  • well-known and widely used.

I rarely recommend anything else if I don't have a specific reason or am not bound by another license.

Copyright (C)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Or Just Hyper-Link It...

Many JavaScript libraries simply provide:

  • a copyright notice,
  • and a URL of a publicly hosted verbatim of the license.

This can be an alternative, which allows you to have still a very clear license and keep it short.

IANAL Disclaimer

Though, IANAL and I'm not entirely sure this hyper-link theory really holds, as links are not really perennial resources (though you might argue you could try to prove what they pointed to or contained at a time T).

Laws regulating software, both national or international, are pretty much still in their infancy. This is all rather gray. So you could just go with it, as for now it's a bit obscure what flies and what doesn't.

share|improve this answer
    
Fine. A BSD is just as well. I don't mind either way. I prefer MIT as I find it to be very simple. –  haylem Jun 27 '12 at 23:01
add comment

A BSD-like license is more business-friendly than a GPL license, a MIT license in this regard is more like a BSD license. Sometimes a MIT license can be considered an evolution or a slightly different approach to the licensing compared to a standard BSD license.

An apache license is probably not for you since it's more indicated for organization and large group of people, it's a GPL-like license but a little bit more complex, an apache license can also involve the use of patents and sometimes this can be a little tricky, the apache license is probably one of the longest license ever written for the free software world and this could be considered an hint.

You can also decide to release your software as "public domain" and with that you simple release your software without any sort of restriction or obligation for the user. Sqlite is an example about public domain software http://www.sqlite.org/copyright.html

this are the most popular approaches, you can easily find all the details about this licenses online or in wikipedia.

share|improve this answer
    
I looked at the MIT license, and it looks like it must still be included in or with the source. I don't want to have to have more than about 100 bytes of overhead. –  Kendall Frey Jun 27 '12 at 13:26
    
@KendallFrey: many javascript libraries simply provide a copyright notice and a link to a publicly hosted verbatim of the license's long version. That can be an alternative, though IANAL and I'm not entirely sure this really holds, as links are not really perennial resources. –  haylem Jun 27 '12 at 22:57
add comment

Don't overthink this.

The license file is small. Even the GPL is only 34KB, and it's the largest of the F/OSS licenses. ZIPped, that's only 13KB. Whoever uses your library will only download it once. They don't need to feed the license to browsers that their users use, so the bandwidth is only consumed once per download, not on every use.

share|improve this answer
add comment

Beware the BSD license!

Its is very "business friendly" in that it allows anyone to copy, modify sell or otherwise steal your code and claim it as thier own. Consider the case where Microsoft made a very small amendment to Kerebros, copyrighted it, patented it and charged the original authors at MIT fot the use their own software.

The GPL is wordy and verbose but it protects you from such abuse.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.