In this video.
Let's talk about the OS module, that is the operating system module.
And this module helps us to know more about our operating system.
So back to a visualized code here.
Let's create a new folder, call it, ask us and then inside I'm going to be as DOT as it can be any
file name.
So as always, to bring in the module, that's all as equal to require the OS module and that is it.
So with this one, if we console.log the OS, we see we have a bunch of properties, a method that we
can make use of it.
So let's open our terminal here and now let me put it side by side.
So let's run the application and now I have to make sure that I see the end to the OS folder.
And in there I have the file called OS, so I'm going to be Node and then the OS and you can see that
we have these methods and properties, for example, the CPU, the free memory and then the load average
and many more.
So let's try to console.log this one.
Let's say how many memory you have and then the hostname, the load average, the total memory and many
more.
So the first property here that we want is to get the type of the operating system so here gets.
The type of operating system.
All right, so here we go.
So consult log the O.
S on that.
We have what is called type as a method.
So let me remove this one from here.
And now let's run the application a little bit bigger here, play the console.
And now indeed I am using Darwin.
That is about my operating system and if I also want to get the platform that you are using, so here
are going to be the Gates platform.
So console log the OS Dart's platform as that's as simple as that.
All right.
So let me comment this one out.
So let's run the application and I'm also on Darwin.
That is my platform.
And if want to know the architecture of your operating system is going to be get the architecture of
your operating system, it's going to be console that log the OS Dart's Ark architecture.
Now let's comment this once.
Now let's play the console here and run the application.
I'm on 64 and if I want to know the total memory of your operating system, why not?
We can get one easily using the OS module, so get the total memory of your operating system and going
to be the console log.
Going to be construed that log o as the total memory as that and let's save it round application and
this is my total memory.
Remember they are in bytes, okay.
And if I also want to get the free memory.
So here a total here is a are here.
So guys now you can get the free memory.
So comment this one, bring this one down here and now it's going to be as free man as a free memory.
Free, ma'am.
All right.
And now this is my free memory in bytes.
And if want to get the uptime of your operating system also as easy get uptime, you're going to be
considered log o s dot the app time.
And let me comment this one out here.
Click the console here and let's run it.
And this is my app time.
One of the method that I want is called to know the user of your operating system.
I like this one a lot and you can use this one to do some logic in your application.
So come down here is going to be get the owner info.
Info about the operating system.
So a console that log the OS dot user info as that.
So let me comment this one here and now.
And this is a user info.
The most important part here is your user name.
We can use the user name in application.
For example, as soon as a user visit our website or application, we want the person.
Hello, welcome.
Meaning that we are using the person's name to display that message.