Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 1.0.0 to 1.0.1

license

27

cli.js
#!/usr/bin/env node
'use strict';
var pkg = require('./package.json');
var meow = require('meow');
var username = require('./');
var argv = process.argv.slice(2);
function help() {
console.log([
'',
' ' + pkg.description,
'',
' Usage',
' username'
].join('\n'));
}
meow([
'Example',
' $ username',
' sindresorhus'
]);
if (argv.indexOf('--help') !== -1) {
help();
return;
}
if (argv.indexOf('--version') !== -1) {
console.log(pkg.version);
return;
}
username(function (err, username) {
console.log(username);
});
{
"name": "username",
"version": "1.0.0",
"version": "1.0.1",
"description": "Get the username of the current user",

@@ -10,7 +10,5 @@ "license": "MIT",

"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
"url": "sindresorhus.com"
},
"bin": {
"username": "cli.js"
},
"bin": "cli.js",
"engines": {

@@ -20,3 +18,3 @@ "node": ">=0.10.0"

"scripts": {
"test": "mocha test.js && mocha test-fallback.js"
"test": "xo && mocha test.js && mocha test-fallback.js"
},

@@ -29,2 +27,3 @@ "files": [

"keywords": [
"cli-app",
"cli",

@@ -41,5 +40,9 @@ "bin",

],
"dependencies": {
"meow": "^3.4.0"
},
"devDependencies": {
"mocha": "*"
"mocha": "*",
"xo": "*"
}
}

@@ -8,3 +8,3 @@ # username [![Build Status](https://travis-ci.org/sindresorhus/username.svg?branch=master)](https://travis-ci.org/sindresorhus/username)

```sh
```
$ npm install --save username

@@ -21,3 +21,3 @@ ```

console.log(username);
//=> sindresorhus
//=> 'sindresorhus'
});

@@ -28,3 +28,3 @@

username.sync();
//=> sindresorhus
//=> 'sindresorhus'
```

@@ -37,9 +37,9 @@

### `username(callback)`
### username(callback)
Falls back to `id -un` on OS X / Linux and `whoami` on Windows in the rare case none of the environment variables are set.
##### `callback(err, username)`
##### callback(error, username)
### `username.sync()`
### username.sync()

@@ -49,11 +49,12 @@

```sh
```
$ npm install --global username
```
```sh
```
$ username --help
Usage
username
Example
$ username
sindresorhus
```

@@ -60,0 +61,0 @@

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