You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

viewport-list-cli

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

viewport-list-cli - npm Package Compare versions

Comparing version
1.0.0
to
1.1.0
+14
-5
cli.js

@@ -5,2 +5,3 @@ #!/usr/bin/env node

var getStdin = require('get-stdin');
var objToTable = require('obj-to-table');
var toCsv = require('to-csv');

@@ -17,7 +18,10 @@ var viewport = require('viewport-list');

' $ viewport-list iphone4 iphone5',
' $ viewport-list < devices.txt'
' $ viewport-list < devices.txt',
'',
'Options',
' -p, --pretty Print the results in a table'
]
});
}, {alias: {p: 'pretty'}});
function run(input) {
function run(input, opts) {
viewport(input, function (err, devices) {

@@ -29,2 +33,7 @@ if (err) {

if (opts.pretty) {
console.log(objToTable(devices).toString());
return;
}
console.log(toCsv(devices));

@@ -35,8 +44,8 @@ });

if (process.stdin.isTTY) {
run(cli.input);
run(cli.input, cli.flags);
} else {
getStdin(function (data) {
[].push.apply(cli.input, data.trim().split('\n'));
run(cli.input);
run(cli.input, cli.flags);
});
}
{
"name": "viewport-list-cli",
"version": "1.0.0",
"version": "1.1.0",
"description": "Return a list of devices and their viewports",

@@ -37,2 +37,3 @@ "license": "MIT",

"meow": "^3.3.0",
"obj-to-table": "^1.0.0",
"to-csv": "^0.0.3",

@@ -39,0 +40,0 @@ "viewport-list": "^3.0.1"

@@ -25,2 +25,5 @@ # viewport-list-cli [![Build Status](http://img.shields.io/travis/kevva/viewport-list-cli.svg?style=flat)](https://travis-ci.org/kevva/viewport-list-cli)

$ viewport-list < devices.txt
Options
-p, --pretty Print the results in a table
```

@@ -27,0 +30,0 @@