Socket
Socket
Sign inDemoInstall

username

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

username - npm Package Compare versions

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc