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

pgm-utils

v1.0.2

Published

A PGM Utils

Readme

PGMUtils

Introduction

A toolkit for parsing and generating PGM files

Version History

| Version Number | Update Content | Updater | | -------------- | -------------------------- | ----------- | | 1.0.0 | PGM parsing and generation toolkit | CorrineCao |

Installation Tutorial

  1. npm install pgm-utils
  2. yarn add pgm-utils

Usage Instructions

  1. Parse PGM to ImageData

    <Upload
     customRequest={async (info: any) => {
         const { file: originFileObj } = info;
         if (originFileObj.name.endsWith('.pgm')) {
             const pgmImg: ImageData = await PGMUtils.PGMTool.getImageDataByPGMBlob(originFileObj);
         }
     }}
     >
         <Button type="primary">Upload and parse PGM file</Button>
     </Upload>
  2. Generate PGM from ImageData

    const pgmBlob: Uint8Array = PGMUtils.PGMTool.getPGMByImageData(imageData);
  3. Unzip and parse zip files with pgm, yaml, and json files

 <Upload
     customRequest={async (info: any) => {
     const { file: originFileObj } = info;
     if (info.file.name.endsWith('.zip')) {
         if (originFileObj) {
         PGMUtils.DeflateTool.inflatePKG(originFileObj).then((res) => {
             console.log('>>>>res:', res);
         });
         }
     }
     }}
 >
     <Button type="primary">Upload and parse compressed PGM file</Button>
 </Upload>
  1. Compress files and return a file object. It supports direct export of ZIP format files, which can include JSON, PGM, and YAML file formats. File names can be customized.

    import PGMUtils from 'pgm-utils';
    
    const record: Record<string, any> = {};
    record['test.json'] = {
        name: 'test',
        ...
    }; 
    record['test.pgm'] = ImageData; 
    record['test.yaml'] = {
         name: 'test',
         origin: [0,0,0],
         ...
    }
    PGMUtils.DeflateTool.deflatePKG(record, 'compressed name');
  2. Directly compress and obtain a File object of ZIP type

 const file = await PGMUtils.DeflateTool.getDeflatePKG(record, 'compressed name');
  1. Compress and directly export the ZIP file

    PGMUtils.DeflateTool.exportDeflatePKG(record, 'compressed name');
  2. Get the content of the uploaded YAML file

    <Upload
         customRequest={async (info: any) => {
             const { file: originFileObj } = info;
             if (originFileObj.name.endsWith('.yaml')) {
                 const yamlInfo = await PGMUtils.YamlTool.getYamlInfoByBlob(originFileObj);
             }
         }}
     >
         <Button type="primary">Upload YAML file</Button>
     </Upload>
  3. Convert string data into YAML file object data

const yamlInfo = PGMUtils.YamlTool.getYamlInfoByContent(yamlContent);
  1. Convert YAML object data into string-type data
const yamlContent = PGMUtils.YamlTool.getContentByYamlInfo(yamlInfo);

Contribute

CorrineCao