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

@kayahr/aseprite

v1.0.0

Published

A set of TypeScript interfaces and enums, API documentation, JSON file typings and JSON schema for Aseprite JSON files

Downloads

56

Readme

aseprite

GitHub | NPM | API Doc

A set of TypeScript interfaces and enums, API documentation, JSON file typings and JSON schema for Aseprite JSON files.

Installation

npm install @kayahr/aseprite

Types

You can use the provided interfaces and enums to work with Aseprite JSON data in a type-safe way:

import * as aseprite from "@kayahr/aseprite";

const response = await fetch("spaceship.aseprite.json");
const spaceship = (await response.json()) as aseprite.SpriteSheet;
const image = spaceship.meta.image;
const isRGBA = spaceship.meta.format === aseprite.Format.RGBA8888;

JSON file typings

This project provides typings for JSON files with the file pattern *.aseprite.json. So when you name your JSON files like this and your module loader supports importing JSON files then you can import the sprite sheets right away and TypeScript already knows the type and can validate your code:

import spaceship from "../sprites/spaceship.aseprite.json";

const image = spaceship.meta.image;
const isRGBA = spaceship.meta.format === aseprite.Format.RGBA8888;

Note that you have to import @kayahr/aseprite somewhere in your application at least once or otherwise TypeScript doesn't load the typings for *.aseprite.json files. If you don't actually need to import an actual type then simply do import "@kayahr/aseprite" somewhere in your code or add node_modules/@kayahr/aseprite/lib/main/aseprite.json.d.ts to the include list in your tsconfig.json.

JSON schema

In case you want to validate Aseprite JSON files or benefit from completion while editing these files there is also a JSON schema file which is automatically generated from the TypeScript types.

You can also access the schema file via your module loader by importing @kayahr/aseprite/aseprite.schema.json.

API documentation

The interfaces and enums describing the Aseprite JSON format are documented so VSCode displays the documentation during completion and in tooltips. There is also a HTML API documentation.