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

@gtfs-jp/types

v4.0.0

Published

GTFS-JP v4 table schema and type definitions for TypeScript

Readme

@gtfs-jp/types

GTFS-JP v4 全33テーブルのスキーマ定義と、スキーマから導出される TypeScript 型を提供します。

Install

npm install @gtfs-jp/types

Usage

テーブル名の一覧と判定

import { GTFS_JP_V4_TABLE_NAMES, isGtfsJpV4TableName } from '@gtfs-jp/types';

console.log(GTFS_JP_V4_TABLE_NAMES);
// ["feed_info", "agency", "stops", "routes", "trips", ...]

isGtfsJpV4TableName('routes'); // true
isGtfsJpV4TableName('unknown'); // false

スキーマの取得

import { getGtfsJpV4TableSchema } from '@gtfs-jp/types';

const schema = getGtfsJpV4TableSchema('routes');
// schema.fileName  → "routes.txt"
// schema.requirement → "required"
// schema.columns   → { route_id: { kind: "string", required: true }, ... }

型付き行データ

import type { GtfsJpV4TableRow } from '@gtfs-jp/types';

// routes テーブルの行型が自動導出される
type RouteRow = GtfsJpV4TableRow<'routes'>;
// { route_id: string; agency_id: string; route_short_name: string | null; route_type: number; ... }

// known GTFS-JP tables are normalized to always expose non-required columns as `null`-able keys

ファイル名とテーブル名の相互変換

import {
  resolveGtfsJpV4TableNameFromFileName,
  resolveGtfsJpV4FileNameFromTableName,
  isGtfsJpV4FileName,
} from '@gtfs-jp/types';

resolveGtfsJpV4TableNameFromFileName('routes.txt'); // "routes"
resolveGtfsJpV4FileNameFromTableName('routes'); // "routes.txt"
isGtfsJpV4FileName('routes.txt'); // true

API

定数

| 名前 | 説明 | | ------------------------ | ------------------------------ | | GTFS_JP_V4_SCHEMA | 全33テーブルのスキーマ定義配列 | | GTFS_JP_V4_TABLE_NAMES | テーブル名の readonly 配列 | | GTFS_JP_V4_FILE_NAMES | ファイル名の readonly 配列 |

関数

| 名前 | 説明 | | ------------------------------------------------- | --------------------------------- | | getGtfsJpV4TableSchema(tableName) | テーブル名からスキーマを取得 | | getGtfsJpV4TableSchemaByFileName(fileName) | ファイル名からスキーマを取得 | | isGtfsJpV4TableName(value) | GTFS-JP v4 テーブル名かどうか判定 | | isGtfsJpV4FileName(value) | GTFS-JP v4 ファイル名かどうか判定 | | resolveGtfsJpV4TableNameFromFileName(fileName) | ファイル名 → テーブル名 | | resolveGtfsJpV4FileNameFromTableName(tableName) | テーブル名 → ファイル名 |

型

| 名前 | 説明 | | ------------------------- | ------------------------------ | | GtfsJpV4TableName | 全テーブル名のユニオン型 | | GtfsJpV4FileName | 全ファイル名のユニオン型 | | GtfsJpV4TableRow<TName> | テーブル名から導出される行の型 | | GtfsJpV4TableSchema | テーブルスキーマの型 | | GtfsJpV4ColumnSchema | カラムスキーマの型 |

スカラー型

CSV の値に意味的な型を付与するブランド型です。実体はすべて string または number です。

GtfsId GtfsText GtfsDate GtfsTime GtfsUrl GtfsEmail GtfsColor GtfsPhoneNumber GtfsTimezone GtfsLanguageCode GtfsCurrencyCode BinaryFlag

License

MIT