Comparing version 1.0.0 to 1.0.1
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 @@ |
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
4154
6
66
1
2
58
+ Addedmeow@^3.4.0
+ Addedarray-find-index@1.0.2(transitive)
+ Addedcamelcase@2.1.1(transitive)
+ Addedcamelcase-keys@2.1.0(transitive)
+ Addedcurrently-unhandled@0.4.1(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedfind-up@1.1.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedindent-string@2.1.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedload-json-file@1.1.0(transitive)
+ Addedloud-rejection@1.6.0(transitive)
+ Addedmap-obj@1.0.1(transitive)
+ Addedmeow@3.7.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@2.1.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@1.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedread-pkg@1.1.0(transitive)
+ Addedread-pkg-up@1.0.1(transitive)
+ Addedredent@1.0.0(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedstrip-bom@2.0.0(transitive)
+ Addedstrip-indent@1.0.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtrim-newlines@1.0.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)