Comparing version 0.1.1 to 1.0.0
23
cli.js
#!/usr/bin/env node | ||
'use strict'; | ||
var fs = require('fs'); | ||
var pkg = require('./package.json'); | ||
var getUsername = require('./index'); | ||
var input = process.argv[2]; | ||
var username = require('./'); | ||
var argv = process.argv.slice(2); | ||
function help() { | ||
console.log(pkg.description); | ||
console.log(''); | ||
console.log('Usage'); | ||
console.log(' $ username'); | ||
console.log(' sindresorhus'); | ||
console.log([ | ||
'', | ||
' ' + pkg.description, | ||
'', | ||
' Usage', | ||
' username' | ||
].join('\n')); | ||
} | ||
if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) { | ||
if (argv.indexOf('--help') !== -1) { | ||
help(); | ||
@@ -21,3 +22,3 @@ return; | ||
if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) { | ||
if (argv.indexOf('--version') !== -1) { | ||
console.log(pkg.version); | ||
@@ -27,4 +28,4 @@ return; | ||
getUsername(function (err, username) { | ||
username(function (err, username) { | ||
console.log(username); | ||
}); |
{ | ||
"name": "username", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "Get the username of the current user", | ||
"license": "MIT", | ||
"repository": "sindresorhus/username", | ||
"bin": { | ||
"username": "cli.js" | ||
}, | ||
"author": { | ||
@@ -15,2 +12,5 @@ "name": "Sindre Sorhus", | ||
}, | ||
"bin": { | ||
"username": "cli.js" | ||
}, | ||
"engines": { | ||
@@ -17,0 +17,0 @@ "node": ">=0.10.0" |
@@ -8,3 +8,3 @@ # username [![Build Status](https://travis-ci.org/sindresorhus/username.svg?branch=master)](https://travis-ci.org/sindresorhus/username) | ||
```bash | ||
```sh | ||
$ npm install --save username | ||
@@ -46,21 +46,21 @@ ``` | ||
You can also use it as a CLI app by installing it globally: | ||
```bash | ||
```sh | ||
$ npm install --global username | ||
``` | ||
#### Usage | ||
```bash | ||
```sh | ||
$ username --help | ||
Usage | ||
$ username | ||
sindresorhus | ||
Usage | ||
username | ||
``` | ||
## Related | ||
- [fullname](https://github.com/sindresorhus/fullname) - Get the fullname of the current user | ||
## License | ||
[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
71
1
2
3208