Architecture

Operating system CPU architecture for which the JavaScript runtime binary was compiled.

Usage

var ARCH = require( '@stdlib/os/arch' );

ARCH

Operating system CPU architecture for which the JavaScript runtime binary was compiled.

console.log( ARCH );
// => <string>

Notes

  • In general, the target build architecture of the JavaScript runtime binary should match the host architecture; however, this is not guaranteed to always be true (e.g., if attempting to run an x64 build of Node.js on an arm64 host machine).

Examples

var ARCH = require( '@stdlib/os/arch' );

if ( ARCH === 'arm' || ARCH === 'arm64' ) {
    console.log( 'Running on ARM...' );
} else {
    console.log( 'Running on something else...' );
}

CLI

Usage

Usage: arch [options]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

$ arch
Did you find this page helpful?