diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/README.md b/README.md index 803fa09..ec48cfa 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ # sixel-check +Run, returns true(0) if sixel support exists, false (1) otherwise + +if [ sixel-check ] +then + echo "Sixels are supported" +else + echo "Sixels are not supported" +fi + diff --git a/index.js b/index.js new file mode 100755 index 0000000..8b0b6b6 --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +#!/usr/bin/env node +const supportsSixel = require("supports-sixel"); + +(async () => { + const isSupported = await supportsSixel(); + + //console.log(isSupported ? "Sixels are supported!" : "Sixels aren't supported!"); + process.exitCode = isSupported ? 0 : 1 +})(); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..d16e6b1 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,40 @@ +{ + "name": "sixel-check", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sixel-check", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "supports-sixel": "^1.0.0" + }, + "bin": { + "sixel-check": "index.js" + } + }, + "node_modules/replied": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replied/-/replied-1.0.1.tgz", + "integrity": "sha512-eol7Yl0vMAdk3W9dKY8T4RDGYiWSRWkRl94HmDABM6/oXrf/5EHbmb4+JNg/nDwBFXJjJ0/hHHOzP4cPgbJ61A==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/supports-sixel": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-sixel/-/supports-sixel-1.0.0.tgz", + "integrity": "sha512-st5KQK5mXTccFVk54ZeweJv07XJZNFZ42d/ooYWx3j49xhbz4tvl8TbpFdUJYURrO7EprIiOGbI6dtGtZN4vzQ==", + "license": "MIT", + "dependencies": { + "replied": "^1.0.1" + }, + "engines": { + "node": ">=10" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..560fec5 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "sixel-check", + "version": "1.0.0", + "description": "", + "license": "ISC", + "author": "", + "type": "commonjs", + "main": "index.js", + "bin": { + "sixel-check": "./index.js" + }, + "dependencies": { + "supports-sixel": "^1.0.0" + } +}