3

I found some similar questions here and in other places, but nothing seemed to quite fit my use case.

I am writing a JavaScript program that imports and uses another library which is licensed under MIT (but this question also holds with respect to other licenses). Since I only refer to the other library by imports, I do not have any copy of its code in my (GitHub) repository. First question: Do I still need to add the license of the used library? My guess is no, but it also does not hurt, so I will probably do it anyway.

Now, all of my source files and the distribution file of the library are packed into one single JavaScript file, which is the finished program. The script to do this is part of the GitHub repository, but the resulting file is not included in the actual git repository. Instead, it will be separately uploaded via GitHub's "release" feature. Second question: Where do I put the license notice of the external library? Is it enough to have it in the GitHub repository (which is linked to the release page and vice versa), or do I need to include a notice on the exact same webpage where the end user will download the program file?

2
  • 1
    Does this answer your question? Several beginner questions about using MIT-licensed code May 30, 2023 at 12:20
  • @Martin_in_AUT It is helpful in general, but not the same situation, as they added an about page to the "distributed program" i.e. website, which I am not able to do. For me, the interesting part is the d3.js / BSD case, which they unfortunately do not really cover in the answer, since there is no "file that you copied third-party code into".
    – Sadret
    May 30, 2023 at 13:02

1 Answer 1

4

Do I still need to add the license of the used library?

If I understand what you've written above correctly, you are distributing copies of this library, so yes, you need to include its licence; and those of any libraries that library uses.

Where do I put the license notice of the external library?

It doesn't really matter, as long as you include it both in the repository and in the distributed copies.

Edit: you need to include it in the former, because it is likely that your work is a copyright derivative of the library. Remember that the decision in Google v Oracle wasn't that APIs aren't copyrightable, but that a particular usage of them was fair use. You could try to run a similar defence, but when you can sidestep it by reproducing a few hundred characters of text, it's simpler just to do that.

As for the latter, you may be minifying your and the library's JS before distributing it, but you are still distributing the library, so you are still obliged to distribute the licence text as part of that. Most good minifiers will allow you to specify comments or other text that is not minified (see eg this answer, and those to which it links, for more details). If you don't want to go to the effort of finding a decent minifier and shipping an extra few hundred bytes of human-readable licence statement with your JS, don't use someone else's copyrighted work.

16
  • I think this does not answer the question. There is a difference between the source code of the program and the compiled program. The first of my questions was regarding the source code, which does not contain a copy of the library, but just a reference to it (i.e. the name). The second question was about the compiled program, which is a single non-human-readable file. So I cannot add any copyright notice "in" the distributed program, only as separate file "with" the distributed program. Especially, I cannot force the users to actually aquire the license file, 99% of them will just ignore it.
    – Sadret
    May 30, 2023 at 12:02
  • 3
    "I cannot add any copyright notice "in" the distributed program" You can do this. Maybe not with your current tooling, but you could if you actually wanted to. May 30, 2023 at 12:09
  • 1
    @Sadret I thought this was JavaScript. By compiled, do you mean minified?
    – MadHatter
    May 30, 2023 at 12:11
  • @MadHatter Yes, basically. It is actually transpiled and minified TypeScript. Point is, it is not human readable.
    – Sadret
    May 30, 2023 at 12:53
  • 1
    @Sadret this is probably not a good place to have that general discussion, but consider downloading a gzip'ed tar file containing all the source for, say, gcc. Somewhere in that tarball, when it's unpacked are some licence files. I've downloaded source like that very many times over the years, but I can count on one hand the number of times I've read the licences included. The terms of the MIT license are pretty clear: you must send that text. That's all. What the user does with it, if anything, is entirely up to them.
    – MadHatter
    May 30, 2023 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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