All right guys I hope that you're able to solve this challenge yourself and you have created this application
and launched it using docker container running.
No just let me know I'll do that myself.
And let me throw just to delete this Files folder.
Let me go out from it and let's use our M desk our F in order to completely remove folder with all files
in sight.
And here I'll type files and now there was no files folder here inside of the load folder.
All right.
Let me go to resource to Dore Gold and this folder actually holds all know just projects that we explore
in this section dedicated to know GSK contain them.
All right.
Let's tap on your folder icon and the let's create new folder called files.
And here inside.
Let's create a single file called index the geos.
You could of course also give any name you wanted this file.
But it's a convention to use in the GFC as a default to file name.
That is actually the default entry point for your no guess application.
All right.
Here I'll use the two built in modules built in internal geos called F S that will handle file right
next to your local computer.
And also I'll use the read line module that will prompt and save a result of your input into variables.
Great.
Let's first require a first module like so const F as people assign require f s next Let's require read
line const red line equals sign or require read line.
And next let's call its method.
Great interface.
Notice that Intel is sounds in the view as code doesn't offer me this option.
And the reason for that is that no the Jesus and NPM are not installed on this computer and that's why
until a sense will fail and it will show you all options.
If you want to get the full reaction of Intel a sense can be scored.
You need to install more just and then bam on your computer.
I don't want to do that on purpose because I want to run all our applications inside of the containers.
But if you want to get intelligence work and give fully and correctly please install no just and then
beam on your computer.
Great.
Here will be create interface and here.
Let's call it like so and let's here pass.
Object as argument and he'll specify it to give all your players with his input and output input we'll
be set to process Dot.
As to D in and the output will be set of process dot as to d out like so and next let's call method
called.
Question of read line object.
Let's do it like so.
Read line dot the question again.
I don't see any suggestions because no Jesus and in beam are not installed in this computer.
But let me go on read line question here will be first question and first question will be enter a file
name.
Let me copy it from here.
Go back here so enter a file name and the result of our input will be assigned to the variable.
And here in this callback function will be single parameter and let's call it file name like so we'll
see who's next.
Our function syntax here will be body of dysfunction.
And here inside left school read line that question once again and let's ask for text.
For this file read line dot question here we'll be on enter text what we actually copied this text from
here and throw some text like so paste it here and there are some text let's add space as well and here
will be a callback function as well and let's assign the result of our input to another variable called
text like so here we'll be again our functional syntax and here inside we are ready to write the specific
file to our file system using this file name and let's add extension to the extent and the contents
of this file will be based on this text that we have entered on this step.
Wonderful.
Let's use a farce module and its method a right file we're actually able to use another method called
the right file sync that will write contest and the file synchronous late but no Jesus is asynchronous
by its nature and this way it lets use here a synchronous method called right file and it will have
additional callback function that will handle some errors if any alright if s dot the right file like
so here throws will be argument that that will actually specify a file name for the file that will be
read them and let's use here back ticks like so because I'll use here template literal expression here
will be dollar assigned then in curly braces I'll write file name like so and next I'll add expansion
dot DST next argument will be a text that will be written to that file here I could simply write text
like so and the last argument will be called the function that will handle any errors if any and if
there are no errors then we will terminate our process and close read line great let's do it here we'll
be single parameter in this function next comes our function syntax and here throws if there was an
error let's throw this error like so and did will actually terminate this process with exit code 1 and
next let's bring into the console text let me copy it from here file was created like so and finally
let's close read line read line dot glows and let's call this method actually that's all what we need
in order to accomplish a jellyfish task.
This application will ask for a file name after we will enter a file name and press enter it will prompt
us for some text we will enter text and finally it will use built in a first module in order to create
new file name the file name the extreme and contents of this file will be based on the text that we
have entered on this second step.
Okay this all let's save this let's verify it.
Fingers crossed.
Let me go here.
Come on take your time and know and make sure that you will see to newly created files folder and here
inside.
Let's run container Docker around.
This should be great.
Well you might be a double you deem well to use here up folder working directory up like so then we'll
be at node it is the name of the container.
Let's also add this I.D. options and finally let's LEDs and our command node index the Jesus we will
execute into the just file located in the files folder.
Here is this file into the geos in the files folder.
Great.
Let's go back to terminal and let's execute this command and our file name.
My file one.
Let's see some text high and file was created.
Let's verify that.
Alas my file won the dig Steve let's or Iran our application once again using same command.
Let's create my file too and the contents will be hey let's these files and you'll see my file to the
disks on the list.
Let's read the contents of my file to the disk Steve and I see hey that's how we were able to create
additional knowledge yes application and we have used the two built in modules of S and we'd like.
I hope you enjoyed this challenge.
And next we will go on and move on to other container gold Mongo.
We will launch a new container based on mongo image and I'll demonstrate you how you're able to open
Mongo CLIA from that container.
I'll see you next.
Bye bye.