CDN based on UNPKG
This started out as a fork from UNPKG, but has since diverged quite a bit as it has been modified to fulfill our needs:
- Parameterized Registry URL for a npm compatible registry, like Artifactory or Nexus
- Static index page, no client and browsing
- No legacy routes support
- Limit available scopes optionally, by setting
SCOPES
environment variable - Dockerized with buildable releases/pre-build images
- Typescript based
- Build tooling based on esbuild
- Optionally provide an
.env
file, see sample file.env.sample
- Use correct Node version, as declared in
.nvmrc
orpackage.json
:nvm use
. - Install dependencies:
npm install
- Build:
npm run build
or - Start locally in node:
node dist/index.js
You must provide UPLINK_* env vars. You may edit those in the docker-compose file.
You build the server and the image yourself and run it:
$ npm run build
$ docker compose up --build
This package uses ESLint for linting. You can run the linter with npm run lint
.
The ESLint config works out of the box with VS Codes ESLint plugin.
Run the tests with npm test
. Additionally, you can run the tests in watch mode with npm run test:watch
.
They are configured to work out of the box with VS Codes Jest plugin.
You can limit the available packages by setting the SCOPES
environment variable. This is useful if you want to limit the available packages to a specific scope, e.g. @some-scope
. Multiple scopes can be separated by a space, e.g. @scope @another-scope
.
If no scope is defined, the whole package name is checked. Thus it is possible to limit the available packages to explicit packages as well, e.g. lit express
.
As the original UNPKG, this project is licensed under the GNU Affero General Public License.