has-ansi-cli
Advanced tools
Comparing version 1.0.0 to 2.0.0
32
cli.js
#!/usr/bin/env node | ||
'use strict'; | ||
var getStdin = require('get-stdin'); | ||
var meow = require('meow'); | ||
var hasAnsi = require('has-ansi'); | ||
const getStdin = require('get-stdin'); | ||
const meow = require('meow'); | ||
const hasAnsi = require('has-ansi'); | ||
var cli = meow({ | ||
help: [ | ||
'Usage', | ||
' $ has-ansi <string>', | ||
' $ echo <string> | has-ansi', | ||
'', | ||
'Example', | ||
' $ ls --color | has-ansi && echo \'has ansi\'', | ||
'', | ||
'Exits with code 0 if input has ANSI escape codes and 1 if not' | ||
] | ||
}); | ||
const cli = meow(` | ||
Usage | ||
$ has-ansi <string> | ||
$ echo <string> | has-ansi | ||
var input = cli.input[0]; | ||
Example | ||
$ ls --color | has-ansi && echo 'has ansi' | ||
Exits with code 0 if input has ANSI escape codes and 1 if not | ||
`); | ||
const input = cli.input[0]; | ||
function init(data) { | ||
@@ -34,3 +32,3 @@ process.exit(hasAnsi(data) ? 0 : 1); | ||
} else { | ||
getStdin(init); | ||
getStdin().then(init); | ||
} |
{ | ||
"name": "has-ansi-cli", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Check if a string has ANSI escape codes", | ||
"license": "MIT", | ||
"repository": "sindresorhus/has-ansi-cli", | ||
"repository": "chalk/has-ansi-cli", | ||
"author": { | ||
@@ -14,3 +14,4 @@ "name": "Sindre Sorhus", | ||
"Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)", | ||
"Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)" | ||
"Joshua Appelman <jappelman@xebia.com> (jbnicolai.com)", | ||
"JD Ballard <i.am.qix@gmail.com> (github.com/qix-)" | ||
], | ||
@@ -21,6 +22,6 @@ "bin": { | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "node test.js" | ||
"test": "xo && ava" | ||
}, | ||
@@ -57,9 +58,14 @@ "files": [ | ||
"dependencies": { | ||
"get-stdin": "^4.0.1", | ||
"get-stdin": "^5.0.1", | ||
"has-ansi": "^2.0.0", | ||
"meow": "^3.3.0" | ||
"meow": "^3.5.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "0.0.4" | ||
"ava": "*", | ||
"pify": "^2.3.0", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# has-ansi-cli [![Build Status](https://travis-ci.org/sindresorhus/has-ansi-cli.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi-cli) | ||
# has-ansi-cli [![Build Status](https://travis-ci.org/chalk/has-ansi-cli.svg?branch=master)](https://travis-ci.org/chalk/has-ansi-cli) | ||
@@ -31,3 +31,3 @@ > Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) | ||
- [has-ansi](https://github.com/sindresorhus/has-ansi) - API for this module | ||
- [has-ansi](https://github.com/chalk/has-ansi) - API for this module | ||
@@ -34,0 +34,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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3566
3
26
+ Addedget-stdin@5.0.1(transitive)
Updatedget-stdin@^5.0.1
Updatedmeow@^3.5.0