I have written a library that is quite extensive and has taken up a lot of my time, so I would like to license it properly. The LGPL seems to have many of the things I want, but does not work with Javascript or other interpreted languages.

Here are the things I want my license to say:

  • My library can be used in commercial application (either web or desktop applications).
  • My library can be used in open source applications (again, any platform is fine).
  • You may not redistribute my unmodified library in any form, except for when the javascript is downloaded to the client's browser.
  • I would like to remain as the copyright owner.
  • If possible, I would like users of my library to be able to use other libraries under any license (though this is less important).

I am fine with distributing source of my library, and I'll have to since it's JS, the thing I don't want is others distributing my unmodified library and saying it is purely their work. I am ok with people modifying and redistributing the library, though I would rather they submitted their work to me and I would give them credit. If they do modify and redistribute the library, they must give me partial credit.

I have also thought about using the MIT license, but it clearly states that people could redistribute my library unmodified, which is the most important thing to me, to make that impossible.

I sincerely apologize if an identical question has been asked on this network, I have done several days' research and have not found one (this is the closest I've gotten, but the answer didn't help me).

Also, IANAL so if any of this is legally contradictory or impossible, please explain rather than just stating that it is impossible.

  • 2
    Your third bullet is completely incompatible with the notion of "open source". If your library is "open source", your users are allowed to distribute the source. – Steven Burnap May 12 '14 at 23:42
  • I am only against their distribution of my unmodified source, if they make it their own, I don't mind, though I would prefer that they submitted their change to my library and I would give them credit. I will make that more clear in the question. – KFox May 12 '14 at 23:44
  • 2
    That itself is not compatible with the notion of "open source". "Open source" means that users can distribute the source. That's the whole point of them. You are describing a closed source license. – Steven Burnap May 12 '14 at 23:47
  • Since I am fine with them making changes and redistributing it, while giving me partial credit. Is that not the whole point of open-source, that they can make changes and redistribute? I'll make another edit to make my willingness to let users modify more clear. – KFox May 12 '14 at 23:54
  • 5
    Why do you think users will distribute unmodified versions without giving credit? Open source licenses generally require the copyright notice to be preserved, which includes the attribution. Preventing people from stealing credit and preventing people from distributing unmodified copies are two different things. – user76704 May 13 '14 at 0:36

(Based on the 8th comment to the question)

If you want your name to remain on all copies and derivative versions, the BSD license is sufficient. BSD in fact requires exactly that, nothing less, nothing more.

The BSD license is compatible with all open-source licenses, and most commercial licenses. (Where not compatible, it's the fault of that other license, so your 5th point is also addressed). However, your third point contradicts your second point, and it's rather pointless anyway. How would you enforce it indirectly? Modifications of modifications, in other words.


This is legally contradictory.

What makes a license "open source" is that it gives the user the right to modify and distribute the source. Indeed, some licenses, like the GPL, compel the user to distribute the source, though others, like the MIT license, simply say that the users may do this. To quote the Open Source Foundation

The program must include source code, and must allow distribution in source code as well as compiled form. Where some form of a product is not distributed with source code, there must be a well-publicized means of obtaining the source code for no more than a reasonable reproduction cost preferably, downloading via the Internet without charge. The source code must be the preferred form in which a programmer would modify the program. Deliberately obfuscated source code is not allowed. Intermediate forms such as the output of a preprocessor or translator are not allowed.

In terms of "retaining copyright", this is pretty easy. As long as you don't explicitly give up your copyright, or explicitly assign it to someone else, you retain it.

If you are talking about letting users modify your source, and then distribute it, that pretty much lets them make a trivial modification, but I gather that when you say you want to let users modify, you mean, you want to let them submit changes to you that you can decide to use (or not.) No special license is needed for that.

It sounds to me that you really just want to use a basic closed source license.

  • "I am ok with people modifying and redistributing the library, though I would rather they submitted their work to me and I would give them credit. If they do modify and redistribute the library, they must give me partial credit." I have no problem with people making "trivial modifications" or even making whole libraries based on parts of my code, I just want partial credit. Sure I would prefer that they submitted their changes, but I don't want to force them. What license would work for what you describe? If they can make trivial modifications, isn't my library then open source? – KFox May 13 '14 at 0:30
  • 1
    @KFox: Your restrictions on "unmodified" are unusual and also pointless. If user A modifies your code, and user B modifies it straight back, the net result is unmodified distribution despite everyone obeying your rules. – MSalters May 13 '14 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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