Socket
Socket
Sign inDemoInstall

pxn-cli

Package Overview
Dependencies
77
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.1 to 1.2.2

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [1.2.2](https://github.com/wolframdeus/pxn-cli/compare/v1.2.1...v1.2.2) (2021-04-20)
### Bug Fixes
* **cli:** add runner ([e4011fc](https://github.com/wolframdeus/pxn-cli/commit/e4011fc64cd7ce489673d4ad01d79626831fa79c))
### [1.2.1](https://github.com/wolframdeus/pxn-cli/compare/v1.2.0...v1.2.1) (2021-04-20)

@@ -7,0 +14,0 @@

1

dist/index.d.ts

@@ -0,1 +1,2 @@

#!/usr/bin/env node
export {};

@@ -0,1 +1,2 @@

#!/usr/bin/env node
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,t,o,r){return new(o||(o=Promise))(function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(i,s)}u((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var o,r,n,a,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(n=(n=i.trys).length>0&&n[n.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var package_json_1=__importDefault(require("../package.json")),commander_1=require("commander"),node_1=require("pxn-core/dist/node"),utils_1=require("./utils"),program=new commander_1.Command;program.name(package_json_1.default.name),program.version(package_json_1.default.version),program.command("image:cut").description("Removes transparent spaces from image. Final image will have minimal rectangle form it can have without additional transparent spaces.").requiredOption("-s --source <path>",'Absolute or relative path to source image. Acceptable extensions are "png", "jpeg" and "jpg"').requiredOption("-o --output <path>",'Path where rescaled image should be saved. Should have extensions "png" or "jpeg"',"./rescaled.png").action(function(e){return __awaiter(void 0,void 0,void 0,function(){var t,o;return __generator(this,function(r){switch(r.label){case 0:return t=e.source,o=e.output,[4,node_1.ImagesProcessor.cut({path:utils_1.toAbsolutePath(t),outputPath:utils_1.toAbsolutePath(o)})];case 1:return r.sent(),[2]}})})}),program.command("image:pixel").description("Pixelizes image.").requiredOption("-s --source <path>",'Absolute or relative path to source image. Acceptable extensions are "png", "jpeg" and "jpg"').requiredOption("-o --output <path>",'Path where rescaled image should be saved. Should have extensions "png" or "jpeg"',"./pixeled.png").requiredOption("-r --resolution <number>","How many pixels should be taken to create new pixel. Pixels are taken with square which square is equal to resolution ** 2.",utils_1.parsePositiveInt).action(function(e){return __awaiter(void 0,void 0,void 0,function(){var t,o,r;return __generator(this,function(n){switch(n.label){case 0:return t=e.source,o=e.resolution,r=e.output,[4,node_1.ImagesProcessor.pixel({path:utils_1.toAbsolutePath(t),resolution:o,outputPath:utils_1.toAbsolutePath(r)})];case 1:return n.sent(),[2]}})})}),program.command("image:resize").description("Resizes image.").requiredOption("-s --source <path>",'Absolute or relative path to source image. Acceptable extensions are "png", "jpeg" and "jpg"').requiredOption("-o --output <path>",'Path where rescaled image should be saved. Should have extensions "png" or "jpeg"',"./resized.png").option("-a --auto","Should be image automatically resized to minimum size.").option("-m --multiply <amount>","How much should image dimensions be multiplied",utils_1.parsePositiveFloat).option("-d --divide <number>","How much should image dimensions be divided",utils_1.parsePositiveFloat).action(function(e){return __awaiter(void 0,void 0,void 0,function(){var t,o,r,n;return __generator(this,function(a){switch(a.label){case 0:if(t=e.source,o=e.multiply,r=e.divide,n=e.output,["auto"in e,o,r].reduce(function(e,t){return void 0===t?e:e+1},0)>1)throw new commander_1.InvalidOptionArgumentError("It is not allowed several resize parameters at the same time");return[4,node_1.ImagesProcessor.resize(__assign({path:utils_1.toAbsolutePath(t),outputPath:utils_1.toAbsolutePath(n)},"auto"in e?{auto:!0}:{config:"number"==typeof o?{type:"multiply",amount:o}:{type:"divide",amount:r}}))];case 1:return a.sent(),[2]}})})}),program.parse(process.argv);

2

package.json
{
"name": "pxn-cli",
"version": "1.2.1",
"version": "1.2.2",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc