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 🙏

© 2026 – Pkg Stats / Ryan Hefner

img2teletext

v5.0.0

Published

TypeScript CLI and library for converting PNG/JPEG images to teletext graphics with multiple output formats

Downloads

12

Readme

img2teletext

This is a CLI application for converting images to teletext level 1 compatible data. Starting from the upper leftmost, the algorithm goes by 2x3 blocks of pixels, and translates them to teletext mosaic charachters. It can also be used as a Node.js library.

poes

It handles images of any dimensions, they don't have to be within the constraints of a standard teletext page.

Requirements

  • Node.js v14 or newer (recommended: v18 or newer)
  • npm v6 or newer (comes with Node.js)

Installation

This module is distributed via npm.

$ npm install -g img2teletext

Command Line Usage

Basic Usage

$ img2teletext <image-file> [options]

Options

  • -V, --version - Output the version number
  • -b, --bin - Generate binary output (default)
  • -e, --edittf - Generate edit.tf URL for online teletext editor
  • -z, --zxnet - Generate ZXNet URL for online teletext editor
  • --base64 - Generate base64 encoded output
  • -j, --json - Generate JSON array output
  • --hash - Generate teletext hash for edit.tf and zxnet compatibility
  • -h, --help - Display help information

Examples

# Convert image to binary teletext data (default output)
$ img2teletext image.png

# Generate a JSON array of teletext character codes
$ img2teletext image.png --json

# Generate a shareable edit.tf URL
$ img2teletext image.png --edittf

# Generate a shareable ZXNet URL
$ img2teletext image.png --zxnet

# Generate base64 encoded data
$ img2teletext image.png --base64

# Generate teletext hash for compatibility
$ img2teletext image.png --hash

Supported Image Formats

  • PNG (.png)
  • JPEG (.jpg, .jpeg)

Using it as a Node.js library

JavaScript (ES5/CommonJS)

const img2teletext = require('img2teletext').default;
const { PNG } = require('pngjs');
const fs = require('fs');

const data = fs.readFileSync('./test/test.png');
const png = PNG.sync.read(data);
const teletextData = img2teletext(png.data, png.width);

console.log(teletextData);

TypeScript

import img2teletext from 'img2teletext';
import { PNG } from 'pngjs';
import fs from 'fs';

const data = fs.readFileSync('./test/test.png');
const png = PNG.sync.read(data);
const teletextData: Uint8Array = img2teletext(png.data, png.width);

console.log(teletextData);

Development

This project is written in TypeScript. To build the project:

npm install
npm run build

To run tests:

npm test

To watch for changes during development:

npm run dev

This code is released under the MIT license, feel free to do whatever you want with it.