Home

Awesome

iquotes

Get inspirational quotes

Build Status NPM version XO code style

<p align="center"> <img src="./banner.png" width="800" style=" box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);"> </p>

Introduction

API of inspirational >280 quotes (Carefully collected) with 3 category:

Install

$ npm install iquotes

Usage

const iquotes = require('iquotes');

iquotes.random();
// {
//   "quote": "The master has failed more times than the beginner has even tried.",
//   "author": "Stephen McCranie",
//   "category": "Life"
// }

// View API for more usage

API

.all(category: string = 'all'): object[]

Get list of all quotes by categories

iquotes.all('life');
// or
iquotes.all(); // To get all quotes

// [
//   {
//     "quote": "The master has failed more times than the beginner has even tried.",
//     "author": "Stephen McCranie",
//     "category": "Life"
//   },
//   {...},
//   ...
// ]

.random(category: string = 'all'): object

Get random quotes from all quotes or by cagegories

iquotes.random(); 
// or
iquotes.random('life'); // To get random life quotes

// {
//   "quote": "The master has failed more times than the beginner has even tried.",
//   "author": "Stephen McCranie",
//   "category": "Life"
// }

.count(category: string = 'all'): number

Get number of all quotes or number of quotes by categories

iquotes.count();
// 280
iquotes.count('love');
// 100

.countDetail(): object[]

Get detail number of all categories

iquotes.countDetail();

// [
//   { type: 'life', count: 162 },
//   { type: 'love', count: 100 },
//   { type: 'dev', count: 18 },
//   { type: 'all', count: 280 } 
// ]

.categories(): string[]

Get supported categories list

iquotes.categories();

// ['life', 'love', 'dev', 'all'];

Supported Categories

Related

License

MIT © Kyoz