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

episode-parser

v2.0.2

Published

Parse file names of tv show episodes.

Downloads

96

Readme

episode-parser

CircleCI NPM release License

A javascript utility for parsing file names in a format that sometimes is used for tv shows.

It parses a file name like this Fake.Blood.2013.S07E06.Karma.Sucks.PROPER.720p.HDTV.x264-STALKERS.srt into an object with the following possible properties:

  • show, string: The name of the show, 'Fake Blood'.
  • year, integer: The release year, 2013.
  • season, integer: The season number, 7.
  • episode, integer: The episode number, 6.
  • episodeCount, integer: The count of episodes this file name includes, 1.
  • name, string: The name of the episode, 'Karma Sucks'.
  • quality, integer: The quality taken from 720p or 1080p. In this case 720.
  • source, string: Available values are 'hdtv', 'webdl', In this case 'hdtv'.
  • codec, string: Codec used, 'x264'.
  • group, string: Release group, 'STALKERS'.
  • ext, string: File extension, 'srt'.

Supported formats

Take a look in the tests for examples of what file name formats are supported.

Usage

Simply require the module and you get a parsing function that you invoke with the file name to parse:

var parser = require('episode-parser')
var filename = 'Fake Blood 2x06 I Need Blood.srt'
var result = parser(filename)
console.log(result.show) //= 'Fake Blood'
console.log(result.year) //= undefined
console.log(result.season) //= 2
console.log(result.codec) //= undefined

If the parser can't parse the file name, null will be returned. If the parser can't parse out a specific details, the property for that detail will be missing from the result.

Installation

npm install episode-parser

Versioning

This package uses semver.

Contributing

If you feel something is missing, which is highly probable since I made this for my personal needs, please create a pull request, with tests covering your case. If you feel somewhat lazy, create an issue instead and I might look into it.

Thank you

Flattr

Building good software and tools takes time. Please do support a future for this project if you are using it. Thank you!