Git Product home page Git Product logo

popular-movie-quotes's Introduction

GitHub license NPM MODULE NPM MODULE NPM MODULE NPM MODULE NPM MODULE NPM MODULE npm GitHub last commit Maintenance Mergify Status

A simple NPM package to get popular movie quotes.

Getting started

NPM

$ npm i popular-movie-quotes --save

Installation

NPM INSTALL NODE JS NODE JS

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

Installation is done using the npm install command:

$ npm i popular-movie-quotes --save

Usage

usage

  • getAll() method returns an array of objects, each containing quote and movie.
{
  "quote": "Frankly, my dear, I don't give a damn.",
  "movie": "Gone with the Wind",
  "type": "movie",
  "year": 1939
}
  • getQuoteByYear(startYear, endYear) method returns a sorted object within the range of year startYear -endYear**
[
    {
        "quote": "Frankly, my dear, I don't give a damn.",
        "movie": "Gone with the Wind",
        "type": "movie",
        "year": startYear
    }
    ...
    .....
    {
        "quote": "Frankly, my dear, I don't give a damn.",
        "movie": "Gone with the Wind",
        "type": "movie",
        "year": endYear
    }
]
  • getSomeRandom(count) method returns an array (of length 'count') of non-duplicate random objects containing quote and movie.
[
  {
    "quote": "Frankly, my dear, I don't give a damn.",
    "movie": "Gone with the Wind",
    "type": "movie",
    "year": 1939
  }
  // with 'count' number of quote objects.
]
  • getRandomQuote() method returns a random movie quote :
I used to think that my life was a tragedy. But now I realize, it’s a comedy.
  • getQuotesByMovie("MovieName") method returns an array with all quotes of MovieName movie, else returns empty.
[
  {
    "quote": "Frankly, my dear, I don't give a damn.",
    "movie": "Gone with the Wind",
    "type": "movie",
    "year": 1939
  }
]
  • getQuotesByType("movie/anime/tv") method returns an array with all quotes of type movie/anime/tv, else returns empty.
[
   {
        "quote": "Frankly, my dear, I don't give a damn.",
        "movie": "Gone with the Wind",
        "type": "movie",
        "year": 1939
    }
    ...
    .....
    {
        "quote": "You all love twisting the knife into one another.",
        "movie": "Knives Out",
        "type": "movie",
        "year": 2019
  }
]
const movieQuote = require("popular-movie-quotes");

console.log(movieQuote.getAll()); //returns an object with all available quotes.

console.log(movieQuote.getSomeRandom(10)); // returns an object of 10 random quotes.

console.log(movieQuote.getRandomQuote()); // returns a random quote

console.log(movieQuote.getQuoteByYear(2000, 2019)); // returns a sorted object within
// the range of year 2000-2019

console.log(movieQuote.getQuotesByMovie("Joker")); //If present returns and array
// with all quotes of joker movie, else returns empty.

console.log(movieQuote.getQuotesByType("anime")); //If present returns and array
// with all quotes of type anime, else returns empty.

Testing

  • Check if quote is duplicate/already present.
$ npm test

Want to contribute?

Open Source Love forthebadge

Please check issues here!

License

GitHub license

Let's get connected

Twitter Follow GitHub followers Facebook Instagram LinkedIn

Special Thanks

Karan Bhatt Facebook Instagram GitHub followers

Rishabh Kanojia Facebook Instagram GitHub followers

Support me for a couple of coffee

Hey! Help me out with a couple of coffee!

Buy Me A Coffee ko-fi


forthebadge forthebadge forthebadge forthebadge

popular-movie-quotes's People

Contributors

afhare avatar akash231997 avatar akshat0109 avatar anselb avatar arihanth007 avatar arthur-justino avatar brianlovega avatar caiohsfar avatar cjthoma1 avatar codemekathy avatar gabrielyong38 avatar hasobi avatar iamsbundela avatar itachihyuga avatar joshuiaclan avatar laviitz avatar lucasagra avatar lucsfreitas avatar manjeet04 avatar mehtadhiraj avatar mergify[bot] avatar navarroguimaraes avatar nikhil9856 avatar nikhilnamal17 avatar pndyjack avatar rvonhoog avatar sakshi171 avatar shivashmahespalsingh avatar shubhankarb180 avatar williamdoyleequiis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.