1.0.1 • Published 2 years ago

convert-staticzap v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

SourceTested?example
raw.githubusercontent.comhttps://raw.githubusercontent.com/svspicious/wisesa.dev/main/README.md
Github.com blobhttps://github.com/svspicious/wisesa.dev/blob/main/public/dino.gif
Github.com rawhttps://github.com/svspicious/wisesa.dev/raw/main/public/preview.png
Gitlab.com blobhttps://gitlab.com/gitlab-org/gitlab-svgs/-/blob/main/illustrations/autodevops.svg
Gitlab.com rawhttps://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