How to add libraries to p5 Web editor?

I am new to using p5 and am struggling to find out how to add libraries to the web editor.

:upside_down_face::upside_down_face:

1 Like

basically for P5.js you use HTML, the
index.html file
to link to libs.
so you start with the defaults:

    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/addons/p5.dom.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/addons/p5.sound.min.js"></script>

( copy from the https://editor.p5js.org/ for a new projects index.html )


https://p5js.org/libraries/
add there are contributed libraries
you can download and link ( see also each example there )
or just link like

<script src="https://cdn.jsdelivr.net/gh/processing/p5.accessibility@0.2.0/dist/p5.accessibility.js"></script>

so as you see there ( at p5.jds) are the 3 main libs loaded by default

  • p5
  • dom
  • sound

already, what is lots to play with,
and the other libs documented there can be added also.

so my question is, why you not started with
β€œi want to do this or that”
if you already know the library what could help you, to do that,
then why you not named it
? kind of confusing?

2 Likes