@stdlib/process-exec-path

Absolute pathname of the executable which started the current Node.js process.

Usage no npm install needed!

<script type="module">
  import stdlibProcessExecPath from 'https://cdn.skypack.dev/@stdlib/process-exec-path';
</script>

README

Executable Path

NPM version Build Status Coverage Status

Absolute pathname of the executable which started the current Node.js process.

Installation

npm install @stdlib/process-exec-path

Usage

var EXEC_PATH = require( '@stdlib/process-exec-path' );

EXEC_PATH

Absolute pathname of the executable which started the current Node.js process.

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

Notes

  • In browser environments and environments other than Node.js, the absolute pathname of the executable is null.

Examples

var EXEC_PATH = require( '@stdlib/process-exec-path' );

if ( EXEC_PATH ) {
    console.log( 'Executable: %s', EXEC_PATH );
} else {
    console.log( 'Not running in Node.js.' );
}

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2022. The Stdlib Authors.