README
NPM package to get popular movie quotes.
A simpleGetting started
$ npm i popular-movie-quotes --save
Installation
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
- 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?
Please check issues here!
License
Let's get connected
Special Thanks
Karan Bhatt
Rishabh Kanojia
Support me for a couple of coffee
Hey! Help me out with a couple of coffee!