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

betterboxd

v1.6.1

Published

Another way of pulling Letterboxd data.

Downloads

14

Readme

Betterboxd

A small npm package to help with fetching Letterboxd data, better. Intended to be used alongside the Letterboxd API, with an even simpler interface and no attempt at authentication.

NOTE: uses /bin/google-chrome on local (i.e., assumes you're on something Linux-like), or playwright-aws-lambda in a deployed environment. So, this limits where you can deploy code that uses this package.

Methods

fetchLetterboxdFilms(username: string, maxPages: number = 5): Promise<{ films: Film[]; totalPages: number; fetchedPages: number }>

Fetches a user's Letterboxd films across multiple pages.

  • Parameters:
    • username: Letterboxd username.
    • maxPages: Maximum number of pages to fetch (default: 5).
  • Returns: A Promise that resolves to an object containing:
    • films: Array of films fetched.
    • totalPages: Total number of pages available.
    • fetchedPages: Number of pages fetched.

fetchLetterboxdFilmsByPage(username: string, page: number = 1): Promise<{ films: Film[]; totalPages: number }>

Fetches a single page of a user's Letterboxd films.

  • Parameters:
    • username: Letterboxd username.
    • page: Page number to fetch (default: 1).
  • Returns: A Promise that resolves to an object containing:
    • films: Array of films for the page.
    • totalPages: Total number of pages available.

fetchLetterboxdDiary(username: string, maxPages: number = 5): Promise<{ films: Film[]; totalPages: number; fetchedPages: number }>

Fetches a user's Letterboxd diary entries across multiple pages.

  • Parameters:
    • username: Letterboxd username.
    • maxPages: Maximum number of pages to fetch (default: 5).
  • Returns: A Promise that resolves to an object containing:
    • films: Array of diary entries fetched.
    • totalPages: Total number of pages available.
    • fetchedPages: Number of pages fetched.

fetchLetterboxdDiaryEntriesByPage(username: string, page: number = 1): Promise<{ films: Film[]; totalPages: number }>

Fetches a single page of a user's Letterboxd diary entries.

  • Parameters:
    • username: Letterboxd username.
    • page: Page number to fetch (default: 1).
  • Returns: A Promise that resolves to an object containing:
    • films: Array of diary entries for the page.
    • totalPages: Total number of pages available.

fetchLetterboxdReviews(username: string, maxPages: number = 5): Promise<{ films: Film[]; totalPages: number; fetchedPages: number }>

Fetches a user's Letterboxd reviews across multiple pages.

  • Parameters:
    • username: Letterboxd username.
    • maxPages: Maximum number of pages to fetch (default: 5).
  • Returns: A Promise that resolves to an object containing:
    • films: Array of reviews fetched.
    • totalPages: Total number of pages available.
    • fetchedPages: Number of pages fetched.

fetchLetterboxdReviewsByPage(username: string, page: number = 1): Promise<{ films: Film[]; totalPages: number }>

Fetches a single page of a user's Letterboxd reviews.

  • Parameters:
    • username: Letterboxd username.
    • page: Page number to fetch (default: 1).
  • Returns: A Promise that resolves to an object containing:
    • films: Array of reviews for the page.
    • totalPages: Total number of pages available.

addTmdbPosterUrls(films: Film[], apiKey?: string): Promise<void>

Adds TMDB poster URLs to the provided films by querying the TMDB API.

  • Parameters:
    • films: Array of film objects to enrich with TMDB poster URLs.
    • apiKey: (Optional) TMDB API key. If not provided, it will use the API key set in environment variables.
  • Returns: A Promise that resolves when TMDB data has been added.

Types

Film

Represents a film with the following structure:

  • id: Film ID.
  • name: Film name.
  • year: Release year.
  • posterUrl: Poster URL from Letterboxd.
  • rating: Film rating.
  • (optional) datetime: Date associated with the diary entry or review.
  • (optional) action: Action such as "Watched", "Rewatched".
  • (optional) reviewText: Text of the review.
  • (optional) likesCount: Number of likes for the review.
  • (optional) tmdbPosterUrl: Poster URL from TMDB.