Skip to content

A Typescript/JavaScript library with Software quotes from developers or people in the Tech industry.

Notifications You must be signed in to change notification settings

codesandtags/open-quotes

Repository files navigation

Open quotes

GitHub release NPM Version

A Typescript/JavaScript library with Software quotes from developers or people in the Tech industry, coming from Open Source to big tech speakers, and writers.

Getting started

Install package

npm install open-quotes

or

yarn add open-quotes

Usage

Using CommonJS

// CommonJS
const quotes = require('open-quotes');

console.log(quotes.getAllQuotes());

console.log(quotes.getQuotesByCategory('Programming'));

Using ES6 Modules or TypeScript:

// ES6 Modules or TypeScript
import quotes from 'open-quotes';

console.log(quotes.getAllQuotes());

console.log(quotes.getQuotesByCategory('Programming'));

Example output:

[
  {
    "quote": "Time is what we want most, but what we use worst.",
    "author": {
      "name": "William Penn",
      "link": "https://en.wikipedia.org/wiki/William_Penn",
      "profileImage": "https://en.wikipedia.org/wiki/File:WilliamPenn.jpg"
    },
    "categories": ["Productivity"]
  },
  {
    "quote": "Everything in software architecture is a trade-off. First law of Software Architecture.",
    "author": {
      "name": "Fundamentals of Software Architecture",
      "link": "https://www.oreilly.com/library/view/fundamentals-of-software/9781492043447/",
      "profileImage": "https://learning.oreilly.com/library/cover/9781492043447/250w/"
    },
    "categories": ["Software Architecture"]
  },
  {
    "quote": "A person who never made a mistake never tried anything new.",
    "author": {
      "name": "Albert Einstein",
      "link": "https://en.wikipedia.org/wiki/Albert_Einstein",
      "profileImage": "https://en.wikipedia.org/wiki/File:Einstein_1921_by_F_Schmutzer_-_restoration.jpg"
    },
    "categories": ["Life"]
  }
]

API Reference

getAllQuotes()

Returns all quotes from the library.

getQuotesByCategory(category: string)

Returns all quotes from the library filtered by category.

Contribute

If you want to contribute to this project or add your quotes, please read the CONTRIBUTING.md file.

About

A Typescript/JavaScript library with Software quotes from developers or people in the Tech industry.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published