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

movie-taste-decider

v0.1.2

Published

A library with which movies can be set as favorites and a movie taste score can be calculated

Downloads

3

Readme

Movie taste decider

This is a small NodeJS library written in TypeScript which enables searching for your favorite movies, save them as such, and determine your personal movie taste based on the imdb scores of your favorite movies.

Caution: This project is not meant to be used in any way in productive software. It is only a showcase project for educational purposes.

How to use

The library uses the OMDb API and requires you to have an API key for it. You can then import the central imdbMovieTasteDecider-class and create an instance of it by passing in your API key as a string like this:

import { imdbMovieTasteDecider } from 'movie-taste-decider'

let tasteDecider = new imdbMovieTasteDecider("yourOmdbApiKey")

imdbMovieTasteDecider implements the movieTasteDecider-Interface which looks like the following:

export interface movieTasteDecider {
    searchForMovie(movieName: string): Promise<movie[]>
    getDetailsForMovie(imdbId: string): Promise<detailedMovie>
    addToFavorites(imdbId: string): void
    removeFromFavorites(imdbId: string): void
    listFavorites(): favorite[] | MovieTasteDeciderError
    clearFavorites(): void | MovieTasteDeciderError
    determineTaste(): tasteResult | MovieTasteDeciderError
}

And you can therefore use all the functions available in the interface.

The library stores your favorites on the file systems at the following place as a default: ~/.movie-taste-decider/favorites.json If you want to specify another place, you can also do that via the constructor, for example:

import { imdbMovieTasteDecider } from 'movieTasteDecider'

let tasteDecider = new imdbMovieTasteDecider("yourOmdbApiKey", "/home/me/customDirectory")

This would result in the favorites being saved at /home/me/customDirectory/favorites.json

Try it out via the REPL console

(A current installation of NodeJS is required for this)

If you check out this repository, you can run npm start to enter a customized node REPL console, which you can use to try out the library. There are two additional commands available:

  • .howToUse: prints out a little help how to use the library in the REPL console
  • .setApiKey: takes a string as an input which is interpreted as your OMDb API key to create an object tasteDecider which is then ready to use.