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

hotel-tvn

v0.1.1

Published

Generate hotel TV / IPTV channel lists from a data JSON. The tool reads a list of service URLs, probes JSON endpoints on the local network, parses channel lists, tests stream availability and speed, then writes **lives.txt** and **lives.m3u**.

Readme

hotel-tvn

Generate hotel TV / IPTV channel lists from a data JSON. The tool reads a list of service URLs, probes JSON endpoints on the local network, parses channel lists, tests stream availability and speed, then writes lives.txt and lives.m3u.

Disclaimer: This project is for learning purposes only. Please delete any generated live source files (e.g. lives.txt, lives.m3u) within 24 hours.

What it does

  1. Reads a data JSON file (e.g. tv_service.json) containing service base URLs.
  2. Expands each base URL into candidate JSON URLs (e.g. scanning last octet 1–255).
  3. Checks which JSON URLs are reachable.
  4. Fetches and parses channel lists from each available JSON endpoint.
  5. Tests each channel stream and measures speed.
  6. Writes the playable channels to lives.txt and lives.m3u in the chosen output directory.

Requirements

  • Node.js (recommended v18+)
  • pnpm (or npm / yarn)

Install

Install globally with npm:

npm install -g hotel-tvn

The tvn and sgen commands will be available on your PATH.

Command-line usage (tvn)

Run with defaults

Uses tv_service.json in the current directory and default concurrency:

tvn

Options:

| Option | Short | Description | | -------------------------- | ----- | --------------------------------------------------------------------------- | | --data-json-path <path> | -d | Path to the data JSON file (default: tv_service.json). | | --live-result-dir <dir> | -o | Directory for lives.txt and lives.m3u (default: current directory). | | --concurrency-json <n> | — | Concurrency for JSON URL checks. | | --concurrency-stream <n> | — | Concurrency for stream speed tests. |

More Examples

# Custom data file and output directory
tvn -d ./my-services.json -o ./output

# Limit concurrency
tvn --concurrency-json 128 --concurrency-stream 32

# Help
tvn --help

How to get tv_service.json

The tv_service.json can be generated from result.json using the sgen command.

If you have a result.json exported from Censys, use genServiceJson to parse it and generate tv_service.json for tvn (each item is { baseUrl, province, city }).

# Use default paths: input dist/result.json, output tv_service.json
sgen parse-result-json

# Specify input and output paths
sgen parse-result-json -i ./my_result.json -o ./my_tv_service.json

| Option | Short | Description | | --------------------------- | ----- | ------------------------------------------------------------ | | --input-json-path <path> | -i | Path to input result.json (default: dist/result.json). | | --output-json-path <path> | -o | Path to output tv_service.json (default: tv_service.json). |

Use as a JavaScript / TypeScript library

Install in your project:

pnpm add hotel-tvn
# or: npm install hotel-tvn

The package supports both CommonJS and ESM and exports types.

ESM

import { build, GenOptions } from 'hotel-tvn';

const options: GenOptions = {
  dataJsonPath: './tv_service.json',
  liveResultDir: './output',
  concurrencyJson: 256,
  concurrencyStream: 64,
};

await build(options);

CommonJS

const { build } = require('hotel-tvn');

await build({
  dataJsonPath: './tv_service.json',
  liveResultDir: './output',
});

Exported API and types

  • build(options?: GenOptions): Promise<void>
    Runs the full pipeline (read data JSON → probe URLs → parse channels → test streams → write lives.txt and lives.m3u). Options match the CLI:

    • dataJsonPath – path to the data JSON file
    • liveResultDir – directory for lives.txt and lives.m3u
    • concurrencyJson – concurrency for JSON checks
    • concurrencyStream – concurrency for stream tests
  • Types: GenOptions, Channel, ParsedChannel, RegionUrl, TvServiceItem (see types.ts).

License

MIT