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

series-word-freq

v1.0.4

Published

## Magically create interactive graphs of word frequency in a TV series

Readme

series-word-freq

Magically create interactive graphs of word frequency in a TV series

Uses the OpenSubtitles API to download subtitle files for a series then we analyse the frequency of words in the subtitles to create an interactive graph of word frequency.

Table of Contents

1. Story behind this project
2. Usage
3. Screenshots
4. OpenSubtitles API

Story behind this project

I saw this Reddit post which I found intriguing. I wanted to see if I could create something similar but for any TV series.

I decided to aim at a deadline of 2 hours to complete a simple MVP implementation of this project idea from start at 1:30am finishing at 3:30am. I managed to complete the project in 7 hours and 30 minutes finishing at 9:00am. I am very happy with the result and I hope you find it useful.

"Work expands so as to fill the time available for its completion" - Parkinson's Law

Usage

  1. Install Node.js (https://nodejs.org/)

  2. Clone this repository git clone [email protected]:martinshaw/series-word-freq.git or download the zip file and extract it.

  3. Install the dependencies by running npm install in the project directory.

  4. Run npm run swf login to login to the OpenSubtitles API. You will need to create an account at https://www.opensubtitles.org/ and get a username, password and an API key. You will be prompted to enter these details or you can add them manually to a .env file. Choose a password that doesn't contain double quotes.

  5. Run npm run swf search "series" to search for a series. Replace series with the name of the series you want to search for.

  6. Browse through the shows using n and p to move to the next and previous pages. When you find the show you want, press s. Press q to quit.

  7. Run the mentioned command npm run swf extract 12345 to extract the subtitles for the show. Replace 12345 with the ID of the show you want to extract.

  8. Run the mentioned command npm run swf download 12345 to download the subtitles for the show.

  9. Run the mentioned command npm run swf analyse 12345 to analyse the subtitles for the show.

  10. Run the command npm run swf chart 12345 to generate a .png image of the word frequency graph for the show.

  11. Run the command npm run swf interactive 12345 to serve an interactive word frequency graph for the show on a local server at http://localhost:5000.

  12. Run the command npm run swf ls or npm run swf list to list the shows you have analysed.

Screenshots

| Login | Search | Extract | Download | Analyse | Chart | | --- | --- | --- | --- | --- | --- | | Login | Search | Extract | Download | Analyse | Chart |

OpenSubtitles API

If you need more help setting up series-word-freq with the OpenSubtitles API. Please follow these simple steps:

  1. Create an account at https://www.opensubtitles.org/

Register

  1. Login to your account and go to the 'API Consumers' page.

API Consumers

  1. Create a new API Key (Consumer). If you are using this for development etc..., you should tick 'Under dev' as this gives you a generous limit of download requests.

Create API Key