How do I handle the license for a node for which I use code from the switch node?

Hi all, I've created a node for which I used the rule engine from the switch node. I've been doing some research on the Apache 2.0 license, but I'm still not sure how I should handle this. I also would like to use the same license. But do I include the original node-red license file in the repo? And what about the file headers? Do I include both the one in the switch node files and mine as well? It's all very unclear to me.

Thanks!

Hi. Just set the licence type in your package.json & add a LICENSE file along side the package file. Easy peasy :slight_smile:

Yes, that's the easy peasy way if all of the code was mine. But like I said, I'm using the rule engine from the switch node which is not only already licensed under Apache 2.0, but also Copyright JS Foundation. Maybe I should've made that part clearer. As far as I've understood, I have to include the original license with the copyright statement? So that would mean two license files?

I am not a lawyer but since you are reusing the same Apache license, from my understanding of section 4 (Redistribution) it should be enough to include the js foundation copyright header something like...

/* A large portion of the code in this file
is based on original works from the
node-red switch node. Below is a copy of
the embedded copyright notice.
*/
/*  JS foundation copyright ... ... ...
.... ... ...
*/

Thanks, thats an idea.