@wener/unpkg
v1.0.5
Published
NPM Registry unpkg
Downloads
2
Readme
@wener/unpkg
Selfhost https://unpkg.com/ , https://cdn.jsdelivr.net/npm/ alternative
- Handler Endpoints
- Unpkg
GET /:pkg@:version
- version metadataGET /:pkg@:version/:file
- NPM
GET /:pkg
- registry indexGET /:pkg/:version
- version metadataGET /:pkg/-/:name-:version.tgz
- tarball - redirect
- [ ] SystemJS - With proper resolve, redirect js to system.ga.jspm.io or dynamic transfer with rollup/swc
GET /system/:pkg@:version
GET /system/:pkg@:version/:file
- Unpkg
- [ ] deploy to https://apis.wener.me/api/unpkg
- with cloudflare cdn
- vercel is blocked by China
- Will resolve range/tag version to exact version
- use 302 redirect
import { Unpkg } from '@wener/unpkg';
import { createBearerAuthFetch, createUnpkg, createUnpkgHandler } from '@wener/unpkg/server';
const unpkg = await createUnpkg({
logger: fastify.log,
url: process.env.UNPKG_REGISTRY,
sqlite: {
database: process.env.UNPKG_CACHE_DB,
},
});
// for private npm registry
if (process.env.UNPKG_TOKEN) {
unpkg.fetch = createBearerAuthFetch(process.env.UNPKG_TOKEN);
}
// for server handler
// NextJS, fastify, etc.
const handler = await createUnpkgHandler({
unpkg,
prefix: '/api/unpkg',
});
Links
- Site
- wener.me
- Blog
- Github wenerme/wener
- apis.wener.me
- APIs playground with docs & stories
- Github wenerme/apis
- wener.me
- Library
- @wener/reaction - -
- React hooks, render, logical components
- helpful typing
- some external minimal helpful utils
- reduce packages
- @wener/utils - -
- utils for daily use
- Document
- @wener/ui - -
- @wener/tinyrpc - -
- rjsf-antd-theme - -
- @wener/reaction - -