diff --git a/lib/node_modules/@stdlib/utils/homedir/README.md b/lib/node_modules/@stdlib/utils/homedir/README.md
new file mode 100644
index 000000000000..52d6f8730a89
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/README.md
@@ -0,0 +1,125 @@
+# homedir
+
+> Return the current user's home directory.
+
+
+
+
+
+
+
+
+
+
+
+
+## Usage
+
+``` javascript
+var homedir = require( '@stdlib/utils/homedir' );
+```
+
+#### homedir()
+
+Returns the current user's `home` directory.
+
+``` javascript
+var home = homedir();
+// e.g., returns '/Users/'
+```
+
+If unable to locate a `home` directory, the function returns `null`.
+
+
+
+
+
+
+
+
+
+## Notes
+
+* The implementation primarily checks various [environment variables][environment-variables] to locate a `home` directory. Note that this approach has __security vulnerabilities__, as attackers can tamper with [environment variables][environment-variables].
+
+
+
+
+
+
+
+
+
+## Examples
+
+``` javascript
+var homedir = require( '@stdlib/utils/homedir' );
+
+console.log( homedir() );
+```
+
+
+
+
+
+
+---
+
+
+
+## CLI
+
+
+
+### Usage
+
+``` bash
+Usage: homedir [options]
+
+Options:
+
+ -h, --help Print this message.
+ -V, --version Print the package version.
+```
+
+
+
+
+
+
+
+
+### Examples
+
+``` bash
+$ homedir
+e.g., /Users/
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[environment-variables]: https://en.wikipedia.org/wiki/Environment_variable
+
+
+
+
diff --git a/lib/node_modules/@stdlib/utils/homedir/bin/cli b/lib/node_modules/@stdlib/utils/homedir/bin/cli
new file mode 100644
index 000000000000..522ce5ba08c1
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/bin/cli
@@ -0,0 +1,90 @@
+#!/usr/bin/env node
+'use strict';
+
+// MODULES //
+
+var fs = require( 'fs' );
+var path = require( 'path' );
+var parseArgs = require( 'minimist' );
+var notifier = require( 'update-notifier' );
+var pkg = require( './../package.json' );
+var opts = require( './opts.json' );
+var homedir = require( './../lib' );
+
+
+// FUNCTIONS //
+
+/**
+* Performs initialization tasks.
+*
+* @private
+* @example
+* init();
+*/
+function init() {
+ var opts;
+
+ // Check if newer versions exist for this package:
+ opts = {
+ 'pkg': pkg
+ };
+ notifier( opts ).notify();
+
+ // Set the process title to allow the process to be more easily identified:
+ process.title = pkg.name;
+ process.stdout.on( 'error', process.exit );
+} // end FUNCTION init()
+
+/**
+* Prints usage information.
+*
+* @private
+* @example
+* help();
+* // => '...'
+*/
+function help() {
+ var fpath = path.join( __dirname, 'usage.txt' );
+ fs.createReadStream( fpath )
+ .pipe( process.stdout )
+ .on( 'close', onClose );
+
+ function onClose() {
+ process.exit( 0 );
+ }
+} // end FUNCTION help()
+
+/**
+* Prints the package version.
+*
+* @private
+* @example
+* version();
+* // => '#.#.#'
+*/
+function version() {
+ var msg = pkg.version.toString()+'\n';
+ process.stdout.write( msg, 'utf8' );
+ process.exit( 0 );
+} // end FUNCTION version()
+
+
+// VARIABLES //
+
+var args;
+
+
+// MAIN //
+
+init();
+
+// Parse command-line arguments:
+args = parseArgs( process.argv.slice( 2 ), opts );
+
+if ( args.help ) {
+ return help();
+}
+if ( args.version ) {
+ return version();
+}
+console.log( homedir() );
diff --git a/lib/node_modules/@stdlib/utils/homedir/bin/opts.json b/lib/node_modules/@stdlib/utils/homedir/bin/opts.json
new file mode 100644
index 000000000000..f245a17e6317
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/bin/opts.json
@@ -0,0 +1,14 @@
+{
+ "boolean": [
+ "help",
+ "version"
+ ],
+ "alias": {
+ "help": [
+ "h"
+ ],
+ "version": [
+ "V"
+ ]
+ }
+}
diff --git a/lib/node_modules/@stdlib/utils/homedir/bin/usage.txt b/lib/node_modules/@stdlib/utils/homedir/bin/usage.txt
new file mode 100644
index 000000000000..2d9f602c7fb0
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/bin/usage.txt
@@ -0,0 +1,8 @@
+
+Usage: homedir [options]
+
+Options:
+
+ -h, --help Print this message.
+ -V, --version Print the package version.
+
diff --git a/lib/node_modules/@stdlib/utils/homedir/examples/index.js b/lib/node_modules/@stdlib/utils/homedir/examples/index.js
new file mode 100644
index 000000000000..624c8bfc89ce
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/examples/index.js
@@ -0,0 +1,5 @@
+'use strict';
+
+var homedir = require( './../lib' );
+
+console.log( homedir() );
diff --git a/lib/node_modules/@stdlib/utils/homedir/lib/homedir.js b/lib/node_modules/@stdlib/utils/homedir/lib/homedir.js
new file mode 100644
index 000000000000..8b13b35898a6
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/lib/homedir.js
@@ -0,0 +1,55 @@
+'use strict';
+
+// MODULES //
+
+var isWindows = require( '@stdlib/utils/is-windows' );
+var platform = require( '@stdlib/utils/platform' );
+
+
+// MAIN //
+
+/**
+* Returns the current user's home directory.
+*
+* @returns {(string|null)} home directory
+*
+* @example
+* var home = homedir();
+* // e.g., returns '/Users/'
+*/
+function homedir() {
+ var home;
+ var user;
+ var env;
+
+ env = process.env;
+ if ( isWindows ) {
+ // https://github.com/libuv/libuv/blob/764877fd9e4ea67c0cbe27bf81b2b294ed33b0f5/src/win/util.c#L1170
+ // https://en.wikipedia.org/wiki/Environment_variable#Windows
+ home = env[ 'USERPROFILE' ] || env[ 'HOMEDRIVE' ]+env[ 'HOMEPATH' ] || env[ 'HOME' ];
+ return ( home ) ? home : null;
+ }
+ // https://github.com/libuv/libuv/blob/9fbcca048181b927cfcdb5c6c49e5bdff173aad5/src/unix/core.c#L1030
+ home = env[ 'HOME' ];
+ if ( home ) {
+ return home;
+ }
+ // Get the current user account (https://docs.python.org/2/library/getpass.html):
+ user = env[ 'LOGNAME' ] || env[ 'USER' ] || env[ 'LNAME' ] || env[ 'USERNAME' ];
+
+ // If on Mac OS X, use the Mac path convention (http://apple.stackexchange.com/questions/119230/what-is-standard-for-os-x-filesystem-e-g-opt-vs-usr)...
+ if ( platform === 'darwin' ) {
+ return ( user ) ? '/Users/'+user : null;
+ }
+ // Check if running as 'root' (https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)...
+ if ( process.getuid() === 0 ) {
+ return '/root';
+ }
+ // If on Linux, use the Linux path convention (https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)...
+ return ( user ) ? '/home/'+user : null;
+} // end FUNCTION homedir()
+
+
+// EXPORTS //
+
+module.exports = homedir;
diff --git a/lib/node_modules/@stdlib/utils/homedir/lib/index.js b/lib/node_modules/@stdlib/utils/homedir/lib/index.js
new file mode 100644
index 000000000000..7f6f6ec1dd07
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/lib/index.js
@@ -0,0 +1,23 @@
+'use strict';
+
+/**
+* Return the current user's home directory.
+*
+* @module @stdlib/utils/homedir
+*
+* @example
+* var homedir = require( '@stdlib/utils/homedir' );
+* var home = homedir();
+* // e.g., returns '/Users/'
+*/
+
+// MODULES //
+
+var os = require( 'os' );
+var isFunction = require( '@stdlib/utils/is-function' );
+var homedir = require( './homedir.js' );
+
+
+// EXPORTS //
+
+module.exports = isFunction( os.homedir ) ? os.homedir : homedir;
diff --git a/lib/node_modules/@stdlib/utils/homedir/package.json b/lib/node_modules/@stdlib/utils/homedir/package.json
new file mode 100644
index 000000000000..3447154a55df
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "homedir",
+ "version": "0.0.0",
+ "description": "Return the current user's home directory.",
+ "author": {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ },
+ "contributors": [
+ {
+ "name": "The Stdlib Authors",
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
+ }
+ ],
+ "bin": {
+ "homedir": "./bin/cli"
+ },
+ "scripts": {},
+ "main": "./lib",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/stdlib-js/stdlib.git"
+ },
+ "homepage": "https://github.com/stdlib-js/stdlib",
+ "keywords": [
+ "stdlib",
+ "stdutils",
+ "stdutil",
+ "utilities",
+ "utility",
+ "utils",
+ "util",
+ "homedir",
+ "dir",
+ "directory",
+ "home",
+ "user",
+ "os",
+ "windows",
+ "darwin",
+ "linux",
+ "mac",
+ "pc"
+ ],
+ "bugs": {
+ "url": "https://github.com/stdlib-js/stdlib/issues"
+ },
+ "dependencies": {},
+ "devDependencies": {},
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "license": "Apache-2.0"
+}
diff --git a/lib/node_modules/@stdlib/utils/homedir/test/test.homedir.js b/lib/node_modules/@stdlib/utils/homedir/test/test.homedir.js
new file mode 100644
index 000000000000..3128026b7fd0
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/test/test.homedir.js
@@ -0,0 +1,347 @@
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var proxyquire = require( 'proxyquire' );
+
+
+// VARIABLES //
+
+var mpath = './../lib/homedir.js';
+
+
+// FUNCTIONS //
+
+/**
+* Returns a copy of the default proxyquire options.
+*
+* @private
+* @returns {Object} options object
+*/
+function makeOpts() {
+ var opts = {
+ '@stdlib/utils/platform': 'darwin',
+ '@stdlib/utils/is-windows': false
+ };
+ return opts;
+} // end FUNCTION makeOpts()
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ var homedir;
+ t.ok( true, __filename );
+ homedir = require( mpath );
+ t.strictEqual( typeof homedir, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function returns a home directory in a non-windows environment (HOME)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'darwin';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'HOME': '/Users/beep'
+ };
+
+ t.strictEqual( homedir(), '/Users/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory in a Mac OS X environment (LOGNAME)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'darwin';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'LOGNAME': 'beep'
+ };
+
+ t.strictEqual( homedir(), '/Users/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory in a Linux environment (LOGNAME)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'linux';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'LOGNAME': 'beep'
+ };
+
+ t.strictEqual( homedir(), '/home/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory in a Mac OS X environment (USER)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'darwin';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'USER': 'beep'
+ };
+
+ t.strictEqual( homedir(), '/Users/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory in a Linux environment (USER)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'linux';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'USER': 'beep'
+ };
+
+ t.strictEqual( homedir(), '/home/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory in a Mac OS X environment (LNAME)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'darwin';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'LNAME': 'beep'
+ };
+
+ t.strictEqual( homedir(), '/Users/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory in a Linux environment (LNAME)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'linux';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'LNAME': 'beep'
+ };
+
+ t.strictEqual( homedir(), '/home/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory in a Mac OS X environment (USERNAME)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'darwin';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'USERNAME': 'beep'
+ };
+
+ t.strictEqual( homedir(), '/Users/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory in a Linux environment (USERNAME)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'linux';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'USERNAME': 'beep'
+ };
+
+ t.strictEqual( homedir(), '/home/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns `null` if unable to locate a home directory in a Mac OS X environment', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'darwin';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {};
+
+ t.strictEqual( homedir(), null, 'returns null' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns `null` if unable to locate a home directory in a Linux environment', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'linux';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {};
+
+ t.strictEqual( homedir(), null, 'returns null' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns the `/root` directory if run as `root` in a Linux environment', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+ var fcn;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/platform' ] = 'linux';
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {};
+
+ fcn = process.getuid;
+ process.getuid = getuid;
+
+ t.strictEqual( homedir(), '/root', 'returns root directory' );
+
+ process.env = env;
+ process.getuid = fcn;
+
+ t.end();
+
+ function getuid() {
+ return 0;
+ }
+});
+
+tape( 'the function returns a home directory on Windows (USERPROFILE)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/is-windows' ] = true;
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'USERPROFILE': 'C:\\Users\\boop'
+ };
+
+ t.strictEqual( homedir(), 'C:\\Users\\boop', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory on Windows (HOMEDRIVE+HOMEPATH)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/is-windows' ] = true;
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'HOMEDRIVE': 'C:',
+ 'HOMEPATH': '\\Users\\boop'
+ };
+
+ t.strictEqual( homedir(), 'C:\\Users\\boop', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns a home directory on Windows (HOME)', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/is-windows' ] = true;
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {
+ 'HOME': 'C:\\Users\\boop'
+ };
+
+ t.strictEqual( homedir(), 'C:\\Users\\boop', 'returns home directory' );
+ process.env = env;
+ t.end();
+});
+
+tape( 'the function returns `null` if unable to locate a home directory on Windows', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = makeOpts();
+ opts[ '@stdlib/utils/is-windows' ] = true;
+ homedir = proxyquire( mpath, opts );
+
+ env = process.env;
+ process.env = {};
+
+ t.strictEqual( homedir(), null, 'returns null' );
+ process.env = env;
+ t.end();
+});
diff --git a/lib/node_modules/@stdlib/utils/homedir/test/test.js b/lib/node_modules/@stdlib/utils/homedir/test/test.js
new file mode 100644
index 000000000000..71758d432f47
--- /dev/null
+++ b/lib/node_modules/@stdlib/utils/homedir/test/test.js
@@ -0,0 +1,60 @@
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var proxyquire = require( 'proxyquire' );
+
+
+// VARIABLES //
+
+var mpath = './../lib/';
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ var homedir;
+ t.ok( true, __filename );
+ homedir = require( mpath );
+ t.strictEqual( typeof homedir, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function aliases `os.homedir` if available', function test( t ) {
+ var homedir;
+ var opts;
+
+ opts = {
+ 'os': {
+ 'homedir': mock
+ }
+ };
+ homedir = proxyquire( mpath, opts );
+
+ t.strictEqual( homedir, mock, 'equals `os.homedir`' );
+ t.end();
+
+ function mock(){}
+});
+
+tape( 'the function supports older Node versions', function test( t ) {
+ var homedir;
+ var opts;
+ var env;
+
+ opts = {
+ 'os': {
+ 'homedir': void 0
+ }
+ };
+ homedir = proxyquire( mpath, opts );
+ env = process.env;
+ process.env = {
+ 'HOME': '/Users/beep'
+ };
+
+ t.strictEqual( homedir(), '/Users/beep', 'returns home directory' );
+ process.env = env;
+ t.end();
+});