• v2.0.0 5b2c7e2554

    v2.0.0
    All checks were successful
    Publish / publish (push) Successful in 13s
    Stable

    michael released this 2026-10-09 09:25:03 +00:00 | 4 commits to main since this release

    Breaking changes

    • The package is now named @michael.thms.uk/link-shortener and is installed from the Forgejo package registry instead of directly from the Git repository. To upgrade, add the registry to your .npmrc:
    @michael.thms.uk:registry=https://code.thms.uk/api/packages/michael/npm/
    

    then switch packages:

    npm uninstall link-shortener
    npm install @michael.thms.uk/link-shortener
    

    and update your imports:

    - import { createShortener } from "link-shortener";
    + import { createShortener } from "@michael.thms.uk/link-shortener";
    

    The API and redirect behaviour are unchanged.

    New

    • Ships compiled JavaScript with type declarations, instead of TypeScript source. It no longer needs a bundler or a runtime that handles .ts files.
    • Node.js support. Node can now import the package directly. The README shows a small node:http adapter.
    • Deno support, with setup and usage instructions in the README.
    • The Shortener type is exported, so it can be imported by name.

    Internal

    • Releases are published automatically by CI when a version tag is pushed, after the typecheck, lint, format check and tests pass.
    Downloads
  • v1.0.1 a6c4ec2b40

    v1.0.1
    All checks were successful
    Test / test (push) Successful in 14s
    Stable

    michael released this 2026-10-08 20:51:22 +00:00 | 9 commits to main since this release

    Downloads
  • v1.0.0 e2ad754f51

    v1.0.0
    All checks were successful
    Test / test (push) Successful in 12s
    Stable

    michael released this 2026-10-08 12:35:46 +00:00 | 12 commits to main since this release

    A tiny, dependency-free redirect handler built on the standard Request / Response APIs. Runs on Cloudflare Workers, Bun, and other Fetch-API runtimes.

    Features

    • Map slugs to absolute URLs and get back a fetch(request) handler
    • Optional root redirect for /
    • Configurable redirect status: 301, 302 (default), 307 or 308
    • Query strings passed through to the target by default, or stripped with stripQueryParams
    • Optional trailing-slash matching (acceptTrailingSlash)
    • URL-decoded, case-sensitive slug matching, including non-ASCII slugs
    • Built-in 404 page, or supply your own HTML with notFoundPage
    • Invalid targets are skipped with a console.error at startup instead of crashing at request time

    Install

    npm install git+https://code.thms.uk/michael/link-shortener.git#v1.0.0
    

    See the README for usage and all options.

    Downloads