Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine a user's operating system through node?

Is there a way to determine the operating system of the user browsing and also whether it is 64 bit or a 32 bit

like image 657
David Christie Avatar asked Jul 13 '16 04:07

David Christie


People also ask

How do I find my client operating system?

To detect the operating system on the client machine, one can simply use navigator. appVersion or navigator. userAgent property. The Navigator appVersion property is a read-only property and it returns a string which represents the version information of the browser.

How do you display OS name in Node JS?

The os. type() method is an inbuilt application programming interface of the os module which is used to get Operating system name.


1 Answers

Use nodejs built in module os for getting architecture information

OS module Docs

  var os = require("os");
  console.log(os.arch());  //ia32

you can use process object

porcess.arch  //'ia32'
like image 102
uzaif Avatar answered Oct 07 '22 15:10

uzaif