tag2link provides formatter URLs for OpenStreetMap keys, enabling conversion of OSM tags into hyperlinks. Version 2026.5.21 is current, updated periodically from Wikidata and OSM Wiki via automated scripts (Python + npm). It replaces `$1` in URL templates with the tag value. Ships TypeScript types. Key differentiator: centralized, community-maintained mapping from OSM keys to authoritative external resources (e.g., Wikidata, OSM Wiki).
npm install tag2linkNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing the default export, looking up a formatter URL by OSM key, and substituting the tag value.
Access directly with the key string as it appears in OSM (e.g., 'highway', 'amenity').
Always check for existence before accessing or use optional chaining.
Use encodeURIComponent($1) in replacement if the template does not expect raw values.
Use dynamic import() or switch to ESM-compatible environment. For older versions, pin to <2026.5.0.
Import directly from 'tag2link' (default export) or from 'tag2link/entries' for array format.
Use `import tag2link from 'tag2link'` instead.
Switch to ESM environment or use dynamic import: `const tag2link = await import('tag2link');`Check the exact OSM key and that a formatter URL exists (e.g., 'highway' works, 'highwayy' does not).
Run `npm install tag2link` and ensure import path is exactly 'tag2link'.
No dependency data recorded yet.