1.1.0 • Published 4 years ago

@varandas/mood-sentences v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

mood-sentences

✨ Mood sentences

Get simple mood sentences.

npm (scoped) npm

Build Status Codecov Coverage semantic-release Known Vulnerabilities

About mood-sentences

This repository was built for the Let's build our first JavaScript npm package tutorial series, published on https://dev.to/iamvarandas/let-s-build-our-first-javascript-npm-package-268l

In this tutorial we build a simple JavaScript package that gets a few mood sentences from a json file. It's a simple package, but you'll learn a lot in the process 🤓.

We cover everything from the setup, coding, adding tests, configuring our CI and finally pushing the package into npm.

  1. Introduction https://dev.to/iamvarandas/let-s-build-our-first-javascript-npm-package-268l
  2. Project setup https://dev.to/iamvarandas/let-s-build-our-first-javascript-npm-package-initial-setup-4pml
  3. Writing code https://dev.to/iamvarandas/let-s-build-our-first-javascript-npm-package-writing-code-10m0
  4. Writing tests https://dev.to/iamvarandas/let-s-build-our-first-javascript-npm-package-writing-tests-1ana
  5. Publishing the package https://dev.to/iamvarandas/let-s-build-our-first-javascript-npm-package-continuous-integration-ebn

Usage

Installation

If you just want to try the package:

npm install --save @varandas/mood-sentences

or with yarn:

yarn add @varandas/mood-sentences

Usiwng the package

const Moods = require('@varandas/moods')

// Get all sentences
const all = Moods.all

// Get all sentences for a specific mood
const anger = Moods.anger
const excitement = Moods.excitement
const boredom = Moods.boredom
const happiness = Moods.happiness

// Get a random sentence for a mood
const randomHappinessSentence = Moods.getRandom(Moods.list.happiness)

LICENSE - MIT - André Varandas