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

@gachou/gachou-api

v0.3.0

Published

Typescript interfaces the describe the apis of the gachou project

Downloads

8

Readme

Gachou API

This project contains the API definitions of the Gachou project.

External APIs

Gachou exposes a RESTful API to the public. The API is currently described by an OpenAPI 2.0 document.

Internal APIs

There are a number of APIs in Gachou

  • core-api: This API is used by the express-layer to access core-functions of Gachou. It exposes all actions like getting date, modifying the index etc
  • tasks-api: This API is used by the Gachou-core implementation to run long running and resource intensive tasks. It limits the number of tasks being run in parallel and provides a rudimentary api for monitoring them.
  • bidder-api: Bidder and auctions are used in several places in order to determine the best plugin to do a job. For example, there may be multiple normalizer plugins, but only one is suitable for videos. The auction gives the file to every plugin and asks for a "bid" (a number of how well this plugin can handle the file) and then gives the file to the plugin with the highest bid.
  • model: This file contains the shared model that is used in the communication between core-api and plugins. This model is also used in some API responses.

Implementations for these interfaces are part of the gachou-backend project.

Plugins / Components

The actual work is done by several components with their own API. Each have a default implementation but can be exchanged (not yet, but the goal is to make this possible).

  • media-store: This component handles the storage and retrieval of media data (i.e. thumbnails and original media files). It provides functions to upload and download both kinds and to iterate all files.
  • metadata-handler: This component handles the extraction and update of metadata within the media files.
  • metadata-index: This component manages an index of the metadata as well and provides methods to update and search it.
  • normalizer: This component converts a media-file to a normalized format that can store XMP-Tags
  • thumbnailer: This component converts a media-file to a thumbnail.

Thumbnail specifications

Thumbnail sizes are specified by a string that is parsed by the gachou-core implementation into an object matching the IParsedScaleSpec-interface The format of this string is

{width}x{height}[-crop]

where

  • {width} is the target width
  • {height} is the target height
  • [-crop] is the optional string -crop. If the string is present, the crop-property will be set to true meaning that the image should be cropped to an exact match of the specified size. Default is to scale the image to fit within a box of the given size.