A simple NPM package to get popular movie quotes.
$ npm i popular-movie-quotes --save
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
- 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"
}
- getQuoteByYear(startYear, endYear)_ method rreturns 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",
"year": startYear
}
...
.....
{
"quote": "Frankly, my dear, I don't give a damn.",
"movie": "Gone with the Wind",
"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"
}
// 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.
const movieQuote = require("popular-movie-quotes");
console.log(movieQuote.getAll()); //get an array with all available quotes.
console.log(movieQuote.getSomeRandom(10)); // get an array of 10 random quotes.
console.log(movieQuote.getRandomQuote()); // get a random quote
- Check if quote is duplicate/already present.
$ npm test
Please check issues here!