Skip to content

kelilipan/convert-staticzap

Repository files navigation

convert-staticzap

A small (UNOFFICIAL) library to convert raw github/gitlab/etc url's to Statically.io CDN url.

(Basically https://statically.io/convert but an npm package)

Usage

Install

yarn add convert-staticzap

or

npm install convert-staticzap

then import

import convert from "convert-staticzap";

const slowRawGithubURL =
  "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/384.gif";
const staticallyURL = convert(slowRawGithubURL);

Supported url

Source Tested? example
raw.githubusercontent.com https://raw.githubusercontent.com/svspicious/wisesa.dev/main/README.md
Github.com blob https://github.com/svspicious/wisesa.dev/blob/main/public/dino.gif
Github.com raw https://github.com/svspicious/wisesa.dev/raw/main/public/preview.png
Gitlab.com blob https://gitlab.com/gitlab-org/gitlab-svgs/-/blob/main/illustrations/autodevops.svg
Gitlab.com raw https://gitlab.com/gitlab-org/gitlab-svgs/-/raw/main/illustrations/autodevops.svg
Bitbucket

More information https://statically.io/docs/using-staticzap/

Motivation

I was using https://github.com/mazipan/graphql-pokeapi to build my app but the sprites is served from slow github CDN, so i make this library to convert that url to Statically.io URL.

lighthouse hate that

Important links

About

(UNOFFICIAL)Tiny library to convert raw github url to Statically.io CDN url

Resources

Stars

Watchers

Forks

Packages

No packages published