npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

imaging

v2.1.2

Published

Draw image into terminal ,whithout node-canvas.Let your command-line terminal not only have characters

Downloads

73

Readme

imaging

travis-ci npm version Dependency Status

Drawing image in your terminal whithout node-canvas,and the outputing image is more clear than using picture-tube.

Imaging, let your terminal outputs more interesting.

imaing

Installing

For node with npm:

windows

npm install imaging -g

Mac/Linux

sudo npm install imaging -g

Node.js Module

npm install imaging --save

Usage

Command line:

imaging https://www.google.com.hk/images/srpr/logo11w.png

Using piping:

echo 'https://www.google.com.hk/images/srpr/logo11w.png' | imaging

options

Set image width

imaging example.png -w 20
## or
imaging example.png --width 20

Set offset left

imaging example.png -l 20
## or
imaging example.png --left 20

imaging left

custom pixel char

imaging example.png -c @
## or
imaging example.png --char #
## if error or don't take effect, try wrapping the char with ""
imaging example.png -c "*"

imaging char names:

  • charmap specific color with specific char, enjoy it.
  • square "▇"
  • circle "●"
  • rectangle" "█"

imaging example.png -c square equal imaging example.png -c ▇

imaing char

Nodejs module

var imaging = require('imaging');
imaging.draw('example.jpg', function (resp, status) {
    /*
      if status == 'success', resp is the image charater string.
      conols.log(resp) to render the image in your terminal
      else if if status == 'fail', resp is the error message
    */
    console.log(status);
    console.log(resp);
});

// limit the width for rendering
imaging.draw('example.jpg', { width: 50}, function (resp, status) {
    /*
      if status == 'success', resp is the image charater string.
      conols.log(resp) to render the image in your terminal
      else if if status == 'fail', resp is the error message
    */
    (status == 'success') && console.log(resp);
});

API

imaging.draw(path, [options], callback) //path could be a remote link or local resource

options: object

  • width - the width of image for rendering
  • left - set the left offset of image
  • char - set the char as pixel of rendered image

callback: function (resp, status)

  • status == "fail" - resp: error msg
  • status == "success" - resp:imaging string in color format

Example

Source image:

source img

Draw into terminal:

imaging render

Support

Now, it dosn't support rendering images with batch processing. So when you want to render multiple images, only the way to imaging image for each.