I would like to share some previous posts which would be good starting points for this discussion:
- Other library right
- Selling Finished projects
- Can I use part of Processing source code in my code?
- Questions about Processing codes and copyright.
- Can I include p5.js in a game download?
- Citing p5.js (academic)?
Some of those previous posts addresses your questions directly.
Kf