downpour
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Downpour

Downpour is a TypeScript port of the Swift library of the same name.

Downpour can gather the following from a raw video name:

  • TV or movie title
  • Year of release
  • TV season number
  • TV episode number

Note: None of the fields are guaranteed to be there or even picked up, since it's kind of hard to extract metadata from file names with only a few clever regular expressions. Please open an issue if you know the data is there, but it's not being picked up. Pull requests are welcome, as well. This also means a lot of members are optional, so be sure to check that the property isn't undefined or nullish coalescing operator (??) to program safely 😄

Installation

# npm
npm install downpour

# yarn
yarn add downpour

# pnpm
pnpm install downpour

Usage

Using Downpour is easy. Just create a new instance and Downpour will do the rest.

import Downpour from "downpour"

let metadata = new Downpour("filenameWithoutExtension")

let title = metadata.title
let year = metadata.year

if (metadata.type === "tv") {
    let season = metadata.season
    let episode = metadata.episode
}

let plexName = metadata.basicPlexName

License

Published under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i downpour

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

11.1 kB

Total Files

5

Last publish

Collaborators

  • roonieone