npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@linkoi/deep-links

v0.1.0

Published

Framework-independent video URL validation and mobile app links.

Readme

@linkoi/deep-links

Resolve video URLs into canonical web URLs and mobile app links. YouTube is the first supported provider. There are no runtime dependencies, network calls, browser globals, framework imports, storage or product-specific routes.

The API is experimental. This public package is versioned independently by Release Please; check npm for published versions. Optional release candidates use the next dist-tag. Pin an exact candidate version while testing in Kitmo. Native app handoff still needs validation on physical iPhone and Android devices, including Instagram and LinkedIn browsers. Always keep a visible HTTPS fallback.

The source lives in the Linkoi repository. npm pack --workspace @linkoi/deep-links produces an ESM artifact with TypeScript declarations. See release instructions for publication and RC testing.

Bundler-based consumers can depend directly on this repository at an immutable commit and import resolveDeepLink from linkoi/deep-links. This Git entry exports TypeScript source and requires a TypeScript-aware bundler such as Vite. Node consumers should use the compiled package artifact instead.

Usage

import { resolveDeepLink } from '@linkoi/deep-links'

const link = resolveDeepLink('https://youtu.be/dQw4w9WgXcQ?t=2m')
if (link) {
  link.provider // 'youtube'
  link.target // { videoId: 'dQw4w9WgXcQ', startSeconds: 120 }
  link.urls.web // canonical HTTPS URL and fallback
  link.urls.ios // best-effort youtube:// URL
  link.urls.android // intent URL with an encoded web fallback
  link.previewImageUrl // YouTube thumbnail URL; not fetched by the package
}

resolveDeepLink returns null for invalid or unsupported input. It accepts YouTube watch, Shorts, live and embed video URLs, including youtu.be, mobile and music hosts. It preserves timestamps and removes playlist context and tracking parameters. Channel and playlist-only URLs are not supported.

Lower-level exports are parseYouTubeUrl, parseYouTubeTime, isYouTubeVideoId, youtubeWebUrl and youtubeAppLinks. URL builders throw TypeError for invalid targets, including negative or noninteger timestamps. The exported types are DeepLink, AppLinks and YouTubeTarget.

The resolver validates URL structure, not video existence, visibility or app installation. Android intents must be invoked by a user gesture. YouTube's iOS scheme is best-effort and is not a published Google API contract. Always show the web URL as an alternative. Embedded browsers can block the handoff.

Product boundary

Linkoi or Kitmo supplies the public domain, route or short-code storage, landing page, device detection, analytics and copy/share interface. The package only resolves the destination. It neither creates a hosted short link nor calls a Linkoi service. Both products can consume it without calling each other.

Kitmo currently maps the resolved target to /r/youtube/<video-id>?t=<seconds>. That route is a Kitmo adapter, not part of this package's API. A future Linkoi service may use its own slugs and domain without changing the resolver.

Development and packaging

From this directory after installing dev dependencies:

npm run build
npm test
npm run check
npm pack

npm pack compiles before packaging and includes only dist, this README and the license and manifest. The artifact runs in Node, Bun and browser/Worker ESM consumers that provide the standard URL and URLSearchParams APIs. No bundler or TypeScript loader is needed to consume the compiled package.

Install root dev dependencies with npm ci. The repository's npm run verify builds all packages, checks their types and runs the Bun tests. Deep-link tests use no live network requests.

Before adding another provider, define its URL allowlist, canonical URL, mobile handoff and web fallback, and add tests for those boundaries. Extend DeepLink as a discriminated union so consumers can handle each target shape. Do not reuse YouTube's path or app scheme for another provider.