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 🙏

© 2024 – Pkg Stats / Ryan Hefner

hyperepg

v0.1.4

Published

EPG (XMLTV) data distributed over a Hypercore Feed.

Downloads

14

Readme

HyperEPG

Sync and distribute an Electronic Program Guide (EPG) from an XMLTV source.

Installation

$ npm install hyperepg

Usage

const hyperepg = require('hyperepg')
const feed = hyperepg('https://example.com/xmltv/epg.xml')

feed.ready(() => {
  feed.sync() // will broadcast EPG
})

API

feed = hyperepg(uri[, opts ])

Factory constructor for a HyperEPG Feed instance.

epg? = feed.sync()

Synchronize feed from network to fetch latest EPG data.

feed.save(document)

Saves a document to the feed. The feed must be writable.

document = hyperepg.createDocument([attributes])

Creates a MediaXML XMLTV document.

const document = hyperepg.createDocument({
  'source-info-url': 'https://example.com/xmltv'
})

node = hyperepg.createNode(name[, attributes[, opts]])

createNode('programme', {
  channel: '1234.channel',
  start: new Date().toISOString(),
  stop: new Date(Date.now() + (60 * 60 * 1000)).toISOString()
}, {
  children: [
    createNode('title', { lang: 'en' }, {
      children: ['Cool Show']
    }),

    createNode('desc', { lang: 'en' }, {
      children: ['A very cool TV show']
    }),

    ...['Comedy', 'Family'].map((name) =>
      createNode('category', { lang: 'en' }, {
        children: [name]
      }))
  ]
})

Schema

syntax = "proto3";

message Header {
  Document document = 1;
  Slice programmes = 2;
}

message Slice {
  int64 start = 1;
  int64 stop = 2;
}

message Document {
  string sourceInfoUrl = 1;
  string sourceInfoName = 2;
  string generatorInfoName = 3;
  string generatorInfoUrl = 4;

  reserved 5 to 10;

  repeated Channel channels = 12;

  message LocalizedText {
    string lang = 1;
    string value = 2;
  }

  message Icon {
    string src = 1;
    float width = 2;
    float height = 3;
  }

  message Channel {
    string id = 1;
    repeated string urls = 2;
    reserved 2 to 9;
    repeated LocalizedText displayNames = 10;
    repeated LocalizedText descriptions = 11;
    reserved 12 to 19;
    repeated Icon icons = 20;
  }

  message Programme {
    string id = 1;
    int64 date = 2;
    int64 start = 3;
    int64 stop = 4;
    string channel = 5;
    string originalLanguage = 6;
    repeated string languages = 7;
    repeated string countries = 8;
    repeated string keywords = 9;
    repeated LocalizedText titles = 10;
    repeated LocalizedText descriptions = 11;
    repeated LocalizedText subtitles = 12;
    repeated LocalizedText categories = 13;
    reserved 14 to 19;
    repeated Icon icons = 20;
    reserved 21 to 24;
    repeated Credit credits = 25;
    repeated EpisodeNumber episodeNumbers = 26;
    VideoDescription video = 27;
    Rating rating = 28;
  }

  message StarRating {
    string value = 1;
  }

  message AudioDescription {
    bool stereo = 1;
  }

  message VideoDescription {
    string aspect = 1;
    string quality = 2;
  }

  message Rating {
    string system = 1;
    string value = 2;
    repeated Icon icons = 3;
  }

  message Credit {
    repeated string directors = 1;
    repeated string actors = 2;
    repeated string presenters = 3;
    repeated string producers = 4;
    repeated string writers = 5;
    repeated string adapters = 6;
    repeated string composers = 7;
    repeated string editors = 8;
    repeated string commentators = 9;
    repeated string guests = 10;
  }

  message EpisodeNumber {
    string system = 1;
    string value = 2;
  }
}

License

MIT