Giter Site home page Giter Site logo

guillaumebarreau / popular-movie-quotes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nikhilnamal17/popular-movie-quotes

0.0 1.0 0.0 1.82 MB

A simple NPM package which returns popular movie quotes.

Home Page: https://www.npmjs.com/package/popular-movie-quotes

License: MIT License

JavaScript 100.00%

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 Travis (.com)

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


Like us a lot? Help others know why you like us! Review this package on pkgreview.dev Review us on pkgreview.dev

Support me for a cup of coffee

Hey! Help me out with a cup of coffee!

Buy Me A Coffee


forthebadge forthebadge forthebadge forthebadge

popular-movie-quotes's People

Contributors

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

Watchers

James Cloos 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.