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

cc-gram

v1.2.10

Published

🖼 A CSS & Canvas Instagram filters based on CSSgram

Readme

🖼 CCgram

NPM Version NPM Downloads JSR Version Test Status License

A CSS & Canvas Instagram filter inspired by CSSgram

🔗 https://eastsun5566.github.io/cc-gram/

Demo GIF

🤔 Why

CSSgram is an excellent CSS filter library. However, there are instances where you might need to access or download the image with filter. This is where CCgram comes into play. It enables you to preview filter using pure CSS and draw them with Canvas whenever you need to.

  • On-Demand: Utilizes CSS for previewing and draws with the Canvas API as needed
  • Non-Blocking: Images are drawn on a Web Worker using OffscreenCanvas & ImageBitmap

✨ Installation

npm i cc-gram

🚀 Usage

Apply CSS filter

HTML

An image tag with data-filter attribute is filter name

<img src="./my-picture.png" data-filter="1977" />

JavaScript

Initialize to apply CSS filter to All targets has data-filter attribute

import { createFilter } from "cc-gram";

const filter = createFilter();
// or you can turn off init apply
const filter = createFilter({ init: false });

// you can also specify data attribute
// i.e., <img data-my-attr="1977">
const filter = createFilter({ dataAttribute: "my-attr" });

Manual apply CSS filter

applyFilter()

// apply to All targets has `data-filter` attribute
filter.applyFilter();

// or you can just use selector for performance
filter.applyFilter("#my-image");
All available filter name list

filterNames

const filterNames = filter.filterNames;
  • Default filter Name list:

    • aden
    • inkwell
    • reyes
    • gingham
    • toaster
    • walden
    • hudson
    • earlybird
    • mayfair
    • lofi
    • 1977
    • brooklyn
    • xpro2
    • nashville
    • lark
    • moon
    • clarendon
    • willow
    • rise
    • slumber
    • brannan
    • valencia
    • maven
    • stinson
    • amaro
Add / Set filter to the filter list

setFilter(name, setting)

  • name: string - The filter name
  • setting: object - The filter setting
filter.setFilter("my-filter", {
  saturate: 0.8,
  contrast: 1.2,
});
  • Available setting key (all value is number):

    • blur
    • brightness
    • contrast
    • grayscale
    • hue-rotate
    • invert
    • saturate
    • sepia
Remove the filter from the filter list

removeFilter(name)

  • name: string - The filter name
filter.removeFilter("my-filter");

Access image with filter

const image = document.querySelector('img[data-filter="1977"]');

Data URL

getDataURL(image[, options = {}])

const dataUrl = await filter.getDataURL(image);

Blob

getBlob(image[, options = {}])

const blob = await filter.getBlob(image, {
  type: "image/jpeg",
  quality: 0.8,
});
  • Options

    • type: string - MIME types, defaults to image/png,
    • quality: number - [0 - 1], defaults to 0.92
    • filter: string - Override filter name, defaults to reading from data attribute
Override filter

You can override the filter applied to the image by passing a filter option:

// Image has data-filter="1977"
const image = document.querySelector('img[data-filter="1977"]');

// Apply a different filter when getting the image data
const dataUrl = await filter.getDataURL(image, { filter: "inkwell" });
const blob = await filter.getBlob(image, { filter: "valencia" });

🔧 Development

# install deps
pnpm i

# fix style
pnpm run lint

# run test
pnpm test

# build for prod
pnpm run build