Welcome back.
In this video, let me show you how we can copy a content from one file onto another.
So looking at these files that we have here, we have two files here about us and then contact us.
You can see that for about us.
We have this content, so we want to copy this content and paste it onto the contact us dot pdf.
So how are we going to do it?
Now let's comment this one and now down here is going to be as copy.
Fire.
So here we go.
Making use of the F.
S module.
And on that we have a method called copy file.
And for this it takes in three arguments.
The first one is the source of the file that you want to copy.
So here we want to copy the about us content.
It's going to be about us dot D or c x.
That is a word format.
So we're going to be about as does D, o, c, x.
The next argument is a file that I want to copy to, and that is going to be the PDF file, which is
contact us the PDF.
So here we go, contact.
As that pdf, the next argument is going to be my callback function.
I have access to the error only.
And here you go.
So let's check if there are some error then why not?
We can go ahead and console.log the error.
Otherwise you will say that errors.
Filed file copied.
Only about us.
This is what we have this manifest pdf and then contact us is also this my first pdf.
I think we should change the text here.
Right, so we can change about us something like let's say about us, simple about us.
Okay.
So now we can use a function to write.
But I think for this one let's do it manually.
So here we go.
On the avatars, we have this content, then I want to put it onto this file.
So let's run the application.
Let me have the terminal here and now.
Here we go.
You see that file copied?
So now let's check it out.
When I open the avatars, if we see that we have about us, likewise.
What?
Contact us.
We also have.
What about us?
So this is how we can copy one content from the other.