Comparing version 2.3.0 to 3.0.0
16
index.js
@@ -24,6 +24,2 @@ 'use strict'; | ||
module.exports = mem(() => { | ||
if (os.userInfo) { | ||
return Promise.resolve(os.userInfo().username); | ||
} | ||
const envVar = getEnvVar(); | ||
@@ -35,2 +31,6 @@ | ||
if (os.userInfo) { | ||
return Promise.resolve(os.userInfo().username); | ||
} | ||
if (process.platform === 'darwin' || process.platform === 'linux') { | ||
@@ -46,6 +46,2 @@ return execa('id', ['-un']).then(x => x.stdout).catch(noop); | ||
module.exports.sync = mem(() => { | ||
if (os.userInfo) { | ||
return os.userInfo().username; | ||
} | ||
const envVar = getEnvVar(); | ||
@@ -57,2 +53,6 @@ | ||
if (os.userInfo) { | ||
return os.userInfo().username; | ||
} | ||
try { | ||
@@ -59,0 +59,0 @@ if (process.platform === 'darwin' || process.platform === 'linux') { |
{ | ||
"name": "username", | ||
"version": "2.3.0", | ||
"version": "3.0.0", | ||
"description": "Get the username of the current user", | ||
@@ -36,4 +36,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"execa": "^0.4.0", | ||
"mem": "^0.1.0" | ||
"execa": "^0.7.0", | ||
"mem": "^1.1.0" | ||
}, | ||
@@ -43,6 +43,3 @@ "devDependencies": { | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
} |
@@ -9,3 +9,3 @@ # username [![Build Status](https://travis-ci.org/sindresorhus/username.svg?branch=master)](https://travis-ci.org/sindresorhus/username) | ||
``` | ||
$ npm install --save username | ||
$ npm install username | ||
``` | ||
@@ -32,3 +32,3 @@ | ||
Returns a promise for the username. | ||
Returns a `Promise` for the username. | ||
@@ -48,2 +48,2 @@ ### username.sync() | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4036
+ Addedcross-spawn@5.1.0(transitive)
+ Addedexeca@0.7.0(transitive)
+ Addedget-stream@3.0.0(transitive)
+ Addedmem@1.1.0(transitive)
+ Addedmimic-fn@1.2.0(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
- Removedcross-spawn-async@2.2.5(transitive)
- Removedexeca@0.4.0(transitive)
- Removedmem@0.1.1(transitive)
- Removednpm-run-path@1.0.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedpath-key@1.0.0(transitive)
Updatedexeca@^0.7.0
Updatedmem@^1.1.0