🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

clipix

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clipix - npm Package Compare versions

Comparing version
0.4.0
to
0.4.1
+33
src/commands/info.js
'use strict'
const logSymbols = require('log-symbols')
const fs = require('fs').promises
const Image = require('../lib/image')
module.exports = async function action (source) {
try {
const sourceStat = await fs.lstat(source)
const sources = !sourceStat.isDirectory() ? [source] : await fs.readdir(source)
const images = await Promise.all(sources.map(async file => {
const isImage = await Image.isImage(file)
if (!isImage) return false
const image = new Image(file)
const { format, width, height, _size } = await image.metadata()
return {
file: file,
format,
width,
height,
_size
}
}))
console.table(images.filter(i => i))
} catch (error) {
console.error(logSymbols.error, error.message)
}
}
+2
-32

@@ -6,9 +6,7 @@ #!/usr/bin/env node

const { Command } = require('commander')
const logSymbols = require('log-symbols')
const { version } = require('../package.json')
const emojic = require('emojic')
const fs = require('fs').promises
const Image = require('../src/lib/image')
const compress = require('../src/commands/compress')
const config = require('../src/commands/config')
const info = require('../src/commands/info')
const updateNotifier = require('update-notifier')

@@ -19,30 +17,2 @@ const pkg = require('../package.json')

async function action (source) {
try {
const sourceStat = await fs.lstat(source)
const sources = !sourceStat.isDirectory() ? [source] : await fs.readdir(source)
const images = await Promise.all(sources.map(async file => {
const isImage = await Image.isImage(file)
if (!isImage) return false
const image = new Image(file)
const { format, width, height, _size } = await image.metadata()
return {
file: file,
format,
width,
height,
_size
}
}))
console.table(images.filter(i => i))
} catch (error) {
console.error(logSymbols.error, error.message)
}
}
async function init () {

@@ -57,3 +27,3 @@ const program = new Command()

.description('Get the information from an image')
.action(action)
.action(info)

@@ -60,0 +30,0 @@ program

{
"name": "clipix",
"version": "0.4.0",
"version": "0.4.1",
"description": "Clipix, nice image editor for the terminal created in Nodejs",

@@ -5,0 +5,0 @@ "main": "index.js",