Giter Site home page Giter Site logo

opentek-org / bookquotes Goto Github PK

View Code? Open in Web Editor NEW
19.0 0.0 39.0 461 KB

Generate lines, author, and book names from people's favorite books and also inspirational quotes!

Home Page: https://www.npmjs.com/package/bookquotes

License: MIT License

JavaScript 100.00%
hacktoberfest npm npm-package javascript quotes literature nodejs

bookquotes's Introduction

bookquotes

bookquotes

NPM VERSION GitHub license NPM MODULE npm collaborators GitHub issues npm downloads

A simple NPM 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 is for you!

GitHub code size in bytes npm GitHub top language

Click here to view this package on NPM registry. Check the homepage here.

Getting started

NPM

$ npm install --save bookquotes

Installation

NPM INSTALL NODE JS inspirational-quotes

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 install bookquotes

Usage

usage

  • getLines() method returns an object containing line , book, and author.
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.
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!
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.
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!

forthebadge

All the tests are in tests folder.

  • Install Jest using
npm install --save-dev jest
  • Run the tests using
npm test

Want to contribute?

Open Source Love PRs Welcome

Please check issues here!

Add Lines from your Favorite Books (Recommended for beginners)

Follow the JSON format and add your content(your favorite line from a book or an inspirational quote) in data file.

Please check HOW TO CONTRIBUTE here!

License

GitHub license Twitter Follow GitHub followers

forthebadge forthebadge forthebadge forthebadge forthebadge

Inspired by this project

bookquotes's People

Contributors

aniketpathak028 avatar anirudhpanda avatar d4rkener avatar danielfrancisolivieri avatar dependabot[bot] avatar devrajdc avatar dikshantgautam2k avatar dipankarmaharana avatar gitaalekhyapaul avatar greeshma2903 avatar himanshuchandola-zz avatar iamtamodip avatar kushank1207 avatar mahich123 avatar miktoscano avatar muzammil-khan710 avatar nandan-shah avatar parthpanchal123 avatar prafulanand avatar saif-malik-01 avatar saijyotitripathy avatar vitorquadros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bookquotes's Issues

Add Lines from your Favorite book

Do you like reading books and a line from the book just remained with you even after you have completed it?
Add that line to data.json inside the data/ folder and raise the PR.

   {  
      "line":"Your favorite lines",
      "book":"Book from which the line is",
      "author":"Author of the book"
   }

Let's share each other's best lines from our favorite book and meanwhile you will get to know a lot of books which may fascinate you.

Create bot greetings for first-time contributors

Problem Description

Greet the first-time contributors with an automated message, when they open a new issue or a PR for the first time.

I would like to take up this issue for Hacktoberfest 2021, if possible.

Change format in inspire.json

Description

Currently, we have inspire.json in the below format:

"line": "The moment you doubt whether you can fly, you cease forever to be able to do it.",
"book": "Per Pan",
"author": "J.M. Barrie"

Can we change it to:

"quote":
"author":

Ig we also have to change index.js accordingly to it. The reason is we just need inspirational quotes and not the book
CC: @gitaalekhyapaul @saif-malik-01

Screenshots

No response

Additional information

No response

Do you want to work on this issue?

  • I want to work on this issue.

Add motivation section.

we can also include motivation quotes, whenever the user call getLines with 'mv' as an arguments is should return motivational quotes only or we can make a whole new function for that.

[BUG] Improper implementation of the `randomInt()` function

Bug Description

The randomInt() function implemented is not valid for this use case. The function is shown below:

Screenshot_20211001_034316

As per W3Schools this generates a random number between min and max (BOTH INCLUDED), which is causing the issue.

Since both min and max can be included, the code is crashing of index out of bounds error sometimes while testing, when the randomInt() returns max. A sample screenshot is given below:

Screenshot_20211001_034241

Push the changes in the v1.2.0 branch instead of main for the next minor release

As our main branch is getting updated almost every day and it is also a good practice to make changes to a release branch and then merge the two branches at regular intervals eg; 15 days and then publish it to npm.

Please push the new changes to v1.2.0 branch instead of main and let's build this package the Open Source Way

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.