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

rel-gl

v1.0.2

Published

Rel GL JS - Interactive map rendering library based on MapLibre GL JS

Readme

rel-gl

Форк MapLibre GL JS с протоколом rel:// и брендингом blinkmaps.

Установка

npm install rel-gl

Быстрый старт

<link href="node_modules/rel-gl/dist/rel-gl.css" rel="stylesheet">
<script src="node_modules/rel-gl/dist/rel-gl.js"></script>

<div id="map" style="width: 100%; height: 100vh;"></div>

<script>
  relgl.accessToken = 'your-token';
  relgl.baseApiUrl = 'https://api.blink-maps.com';

  const map = new relgl.Map({
    container: 'map',
    style: 'rel://api/styles/meringue_light_style.json',
    center: [37.6173, 55.7558],
    zoom: 10,
    attributionControl: false
  });

  map.addControl(new relgl.NavigationControl(), 'top-right');

  map.on('load', () => {
    console.log('Map loaded');
  });
</script>

ES модули

import relgl from 'rel-gl';
import 'rel-gl/dist/rel-gl.css';

relgl.accessToken = 'your-token';
relgl.baseApiUrl = 'https://api.blink-maps.com';

const map = new relgl.Map({
  container: 'map',
  style: 'rel://api/styles/meringue_light_style.json',
  center: [37.6173, 55.7558],
  zoom: 10
});

map.addControl(new relgl.NavigationControl());

Конфигурация

// Свойства (рекомендуемый способ)
relgl.accessToken = 'your-token';
relgl.baseApiUrl = 'https://api.blink-maps.com';

// Геттеры/сеттеры (тоже работают)
relgl.setAccessToken(token);
relgl.setBaseApiUrl(url);
relgl.getAccessToken();
relgl.getBaseApiUrl();

accessToken передается как query-параметр api_key во всех запросах через rel://.

baseApiUrl по умолчанию пустой — его нужно установить перед загрузкой стиля.

Протокол rel://

rel:// резолвится в baseApiUrl:

rel://path/to/resource  ->  {baseApiUrl}/path/to/resource

Тайловые запросы (arrayBuffer, кроме шрифтов) автоматически идут через поддомен tiles..

Кастомный протокол-хэндлер

Можно переопределить встроенный хэндлер:

relgl.addProtocol('rel', async (params, abortController) => {
  const response = await fetch(myResolve(params.url), {
    signal: abortController.signal
  });
  const data = params.type === 'json'
    ? await response.json()
    : await response.arrayBuffer();
  return { data };
});

Маркеры и попапы

const marker = new relgl.Marker({ color: '#e94560' })
  .setLngLat([37.6173, 55.7558])
  .setPopup(new relgl.Popup().setText('Moscow'))
  .addTo(map);

Навигация

map.flyTo({ center: [30.3158, 59.9398], zoom: 14, duration: 2000 });
map.easeTo({ bearing: 45, duration: 800 });
map.fitBounds([[29.5, 59.7], [31.2, 60.2]], { padding: 60 });

API

Такой же как у MapLibre GL JS — только relgl вместо maplibregl.

Сборка из исходников

npm install
npm run build-prod
npm run build-css

Результат в dist/.

Лицензия

BSD-3-Clause