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

has-ansi-cli

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has-ansi-cli - npm Package Compare versions

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 @@

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