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

@russian-flags/samara-oblast

v1.0.0

Published

SVG flags and city metadata for Samara Oblast, Russia for JavaScript and TypeScript: ESM imports and lazy loaders.

Readme

@russian-flags/samara-oblast

English version

Нативная ESM-коллекция SVG-флагов и метаданных городов Самарской области. Структура пакета повторяет @russian-flags/moscow-oblast: локальные SVG лежат в assets/<slug>/index.svg, при сборке копируются в dist/flags/<slug>.svg, а для JavaScript/TypeScript доступны ленивые загрузчики.

Список основан на странице Wikipedia "Городские населённые пункты Самарской области", раздел "Города": 11 городов. Посёлки городского типа не включены.

Города

| Город | Флаг | slug | | --- | --- | --- | | Жигулёвск | | zhigulevsk | | Кинель | | kinel | | Нефтегорск | | neftegorsk | | Новокуйбышевск | | novokuybyshevsk | | Октябрьск | | oktyabrsk | | Отрадный | | otradnyy | | Похвистнево | | pohvistnevo | | Самара | | samara | | Сызрань | | syzran | | Тольятти | | tolyatti | | Чапаевск | | chapaevsk |

Возможности

  • 11 локальных SVG-флагов в структуре assets/<slug>/index.svg.
  • ESM-сборка с TypeScript-типами.
  • Ленивые загрузчики для каждого флага.
  • Поиск города по slug, коду, русскому/английскому названию или alias.
  • Прямой импорт SVG через flags/<slug> или svg/<slug>.

Установка

npm install @russian-flags/samara-oblast

Для локальной проверки из папки проекта:

npm install .

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

import { loadFlag, settlements } from "@russian-flags/samara-oblast";

console.log(settlements.length); // 11

const image = await loadFlag("samara", {
  alt: "Флаг Самары",
  className: "flag",
});

document.body.append(image);

Подключение SVG напрямую

import samaraFlag from "@russian-flags/samara-oblast/flags/samara";
import samaraSvg from "@russian-flags/samara-oblast/svg/samara";

console.log(samaraFlag);
console.log(samaraSvg);

Вариант с расширением тоже поддерживается:

import samaraFlag from "@russian-flags/samara-oblast/flags/samara.svg";
import samaraSvg from "@russian-flags/samara-oblast/svg/samara.svg";

Поиск города

import {
  resolveSettlementSlug,
  settlementSlugs,
  settlements,
} from "@russian-flags/samara-oblast";

console.log(settlementSlugs.includes("samara")); // true
console.log(resolveSettlementSlug("Самара")); // "samara"
console.log(resolveSettlementSlug("Togliatti")); // "tolyatti"
console.log(resolveSettlementSlug("Безенчук")); // undefined

Ввод нормализуется: пробелы по краям удаляются, регистр не важен, ё считается как е, пробелы и _ заменяются на -.

API

| Экспорт | Описание | | --- | --- | | settlements | Массив метаданных { slug, code, nameRu, nameEn, aliases }. | | settlementSlugs | Массив всех доступных slug. | | normalizeSettlementInput(input) | Нормализует пользовательский ввод перед поиском. | | resolveSettlementSlug(input) | Возвращает slug по slug, коду, названию или alias. | | getFlagModuleLoader(input) | Возвращает ленивый загрузчик модуля флага или undefined. | | loadFlagModule(input) | Лениво импортирует модуль флага. | | loadFlagImage(input, options) | Загружает флаг и возвращает HTMLImageElement. | | loadFlag(input, options) | Алиас для loadFlagImage. | | preloadFlag(input) | Запускает загрузку модуля без ожидания результата. | | createFlagImage(src, defaultAlt, options) | Создаёт и настраивает <img> для SVG-флага. |

Разработка

npm install
npm test
npm run pack:dry