bookquotes
Version:
Collection of people's favorite quotes from books around the world
154 lines (98 loc) • 7 kB
Markdown

# bookquotes
[](https://www.npmjs.org/package/bookquotes) [](https://github.com/Opentek-Org/bookquotes/blob/main/LICENSE) [](https://github.com/Opentek-Org/bookquotes) [](https://www.npmjs.com/package/bookquotes) [](https://www.npmjs.com/package/bookquotes) [](https://www.npmjs.com/package/bookquotes)
#### A simple [NPM](https://www.npmjs.com/package/bookquotes) Package which returns
- random **Lines** from people's favorite book with names of the **author** as well as the **book** . It provides great and aesthetic quotes to display in your application.
- random **inspirational quotes**. Get your daily quote and stay motivated!
#### If you like to read books, literature and want to stay motivated and inspired, this [package](https://opentek-org.github.io/bookquotes/) is for you!
[](https://www.npmjs.com/package/bookquotes) [](https://www.npmjs.com/package/bookquotes) []()
**Click [here](https://www.npmjs.com/package/bookquotes)** to view this package on **NPM** registry. Check the homepage **[here](https://opentek-org.github.io/bookquotes/)**.
## Getting started
[](https://nodei.co/npm/bookquotes/)
```
$ npm install --save bookquotes
```
## Installation
[](https://docs.npmjs.com/getting-started/installing-npm-packages-locally) [](https://nodejs.org/en/) [](https://www.npmjs.com/package/inspirational-quotes)
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/).
Before installing, [download and install Node.js](https://nodejs.org/en/download/).
Installation is done using the
**[`npm install`](https://docs.npmjs.com/getting-started/installing-npm-packages-locally)** command:
```bash
$ npm install bookquotes
```
## Usage
[](https://github.com/Opentek-Org/bookquotes/)
- **_getLines()_** method returns an object containing **_line_** , **_book_**, and **_author_**.
```js
const Line = require("bookquotes");
console.log(Line.getLines()); // generates an object having a line, name of book and author.
```
Output:
```
{
line: 'I had the epiphany that laughter was light, and light was laughter, and that this was the secret of the universe.',
book: ' Donna Tartt',
author: 'The Goldfinch'
}
```
- **_getLines(*typeCode*)_** method returns an object containing **_quote_** and **_author_**.
```js
const Line = require("bookquotes");
console.log(Line.getLines("isp")); // generates an object having a line, name of book and author.
```
- **_Type codes_**
```
'isp' = inspire
```
Output:
```
{
quote: 'When you start to love yourself for the first time, your scars start to look a lot more like beauty marks.',
author: 'Jacob Tobia'
}
```
- **_getRandomLine()_** method returns a random **aesthetic** line!
```js
const Line = require("bookquotes");
console.log(Line.getRandomLine()); // generates a single aesthetic line
```
Output:
```
All we have to decide is what to do with the time that is given us.
```
- **_getRandomLine(*typeCode*)_** method returns a specific **type** random aesthetic line.
```js
const Line = require("bookquotes");
console.log(Line.getRandomLine("isp"));
```
- **_Type codes_**
```
'isp' = inspire
```
Output:
```
When you start to love yourself for the first time, your scars start to look a lot more like beauty marks.
```
## Testing the package!
[](https://forthebadge.com)
All the tests are in [tests](https://github.com/Opentek-Org/bookquotes/tree/main/__tests__) folder.
- Install Jest using
```
npm install --save-dev jest
```
- Run the tests using
```
npm test
```
## Want to contribute?
[](https://github.com/vinitshahdeo) [](https://github.com/Opentek-Org/bookquotes/pulls)
> Please check issues **[here](https://github.com/Opentek-Org/bookquotes/issues)**!
**[Add Lines from your Favorite Books](https://github.com/Opentek-Org/bookquotes/issues/1)** (Recommended for beginners)
### Follow the JSON format and add your content(your favorite line from a book or an inspirational quote) in [data](https://github.com/Opentek-Org/bookquotes/tree/main/data) file.
> Please check HOW TO CONTRIBUTE **[here](CONTRIBUTING.md)**!
## License
[](https://github.com/Opentek-Org/bookquotes/blob/main/LICENSE) [](https://twitter.com/anirudhpandaaa) [](https://github.com/AnirudhPanda/)
[](https://forthebadge.com) [](https://forthebadge.com) [](https://forthebadge.com) [](https://forthebadge.com) [](https://forthebadge.com)
Inspired by [this](https://github.com/vinitshahdeo/inspirational-quotes) project