hello welcome to a video tutorial about
something related to p5 called p5
manager now p5 manager is by chin how
you thank you for making this wonderful
tool I hope that it's okay that I'm
making a video about it I am NOT an
expert I did not I can take no credit
whatsoever for this wonderful thing
called p5 manager but I knew about it
and I can use it in class the other day
and it really helped me out so I wanted
to make a video so other people would
learn about it so ok so what is p5
minute or you guys might be aware that
one of the things that I do it's a
really bad habit sometimes when I want
to make a new sketch I go to p5.js org
it's a great technique here then I go to
download then I'm like oh which leg
download oh ok I'm gonna download p5 GS
complete and I click on that and it
download something and then I find it
you can see look at me this is how
ridiculously horrible I am you could see
that I have done this is like big 95 the
same thing I just download it and then I
like opened it up and when I find
somewhere in here like oh there's like
empty example and I rename it or I copy
it somewhere and that's like my new
sketches i'ma do this is not a great
workflow p5 manager is a command-line
tool that you can execute from the
command line what's the command line you
know have you since some videos you
might it uses it's built on top of
something called node and I have another
video that I'll link to about what is
know but you don't really need to know
what note it is you do need to install
node to use this so you can go to
node.js org install node and then you
can use this node comes with something
called NPM which is stands for node
package manager which is a way to manage
the packages you want to use with node
and but why is this relevant because p5
manager is a node package a node is a
server-side programming framework in
JavaScript and there's a lot that we
could say about things that you could do
with it but we're not really doing
anything with node whatsoever we're just
lucky to bask in the glory and somebody
else bothered to make something with
node called p5 manager so if I've
installed dode the next thing I can do
is go here and I can run this command so
what I want to say is NPM node package
manager install I won't install
something - G - G is an
kind of an important detail but not so
important for us right now it means I
want to install this globally meaning
it's not part of an individual project
it's this thing that I just want to use
always on my computer from now on p5
manager is my thing now so I can take
this and I can say copy it and I can
then go to here and I'm gonna just paste
it in I could have just typed it might
give me an error it might give me an
error this might happen to you
we're in a hope this error doesn't
happen but it might happen in fact I
mean good if it happens because if it
happens then you'll see it happen and
you'll know how to fix it
oh yeah they got the error alright so
what is the error now the air is
permission denied and this is actually
has to do with the fact that we we want
to install it globally the if we'd salty
means it has to go in the like depths of
your computer where only the
administrator whoever that is maybe you
can like you've got to like get into the
guts of the system files in all sorts of
fancy places that you have to have
permission for so there's a way to get
permission to do that and the way to do
that with terminal is by saying a sudo
which stands for Super User do Super
User do NPM - G no no I don't know I
don't know what the order this really
matters install - G was in back out p5 -
manager and now oh it asked for my
password and good thing I think I know
think I know the password
sorry about that hopefully you're
watching this and I'm now just
reappeared and I figured out the
password and entered it so I'm gonna run
the sudo command for Hewitt can with the
correct password so you can watch
okay hey that seemed to have worked so
now I have installed forevermore the p5
manager with note so there are a bunch
of things you can do with the p5 manager
and I encourage you maybe I'll come back
to these if it's interesting or but I
want to show you like these kind of like
the simplest way ever to use it so the
p5 manager will actually allow you to
create a collection of sketches and you
can you can serve them up and run us and
like makes it like a little like web
page with a like a table of contents of
all the things you've made but and you
should you could follow these
instructions for that but I'm actually
going to scroll down and what I want to
do is just generate a standalone project
so I for me in making examples and I put
them in all different places it's less
about a collection right now and then
individual like standalone projects so I
want to do this anytime I write now that
I've installed that package I can just
write p5 anytime in my terminal window
now and it's gonna say look hey you've
installed p5 manager zero point three
point two so but whenever I want to run
a specific p5 command like p5 generate
that's going to generate a project and
then I have to give it some specific
parameters arguments of what kind of
project I want to generate so what I
want to do is I want to generate a
bundle with a particular name and for
short you can also just type p5 G - B
but I'm gonna be long-winded about it
for the purpose of this video tutorial -
- bundle and coding train will be the
name of my project and I'm going to hit
enter so now that this worked I realized
I kind of did something pretty terrible
which is when you first open at least on
the Mac your terminal window it just
plops you right into the root directory
of your computer and that's probably not
where I want to put my coding train
project so you know this is a bit of an
aside but I can you can change
directories I could say like CD
documents because really what I want to
do is be in the documents and I can make
a folder called something like p5
project which already exists
there and I could say CVP five projects
and then now what I want to do is go
back and run this one more time to get
it right I'm gonna run that one more
time you can see it created those
projects I can go back to the finder I
can go into p5 projects and I can see
look at what I've got I have now have a
folder called coding train which really
is just one project it's got the HTML
file it's got the sketch J's file it's
got that whoops which I just opened up
by accident and it's got the the
libraries folder with the p5 libraries
so this is the way to create an
individual single p5 project I can do
this all the time now I'm gonna do it in
one of my future videos I can edit and
work on it that way and we'll always get
the most current version to the p5
library and I encourage you to explore
also the collection the collection
functionality of this as well which you
can make a nice little like what page it
doesn't automatically with all your
projects ok so thank you for watching
about the p5 manager hopefully it's
useful to you I will see you in a future
video or you might see me using the p5
manager thank you very much
[Music]
you