1.0.1 • Published 2 years ago
naija-relationshipjs v1.0.1
naija-relationshipjs
A simple npm library for handling relationships, breakups, and more.
Installation
You can install naija-relationshipjs using npm or yarn:
npm install naija-relationshipjs
# or
yarn add naija-relationshipjsUsage
Basic Usage
const { Person, Relationship, Breakup } = require('naija-relationshipjs');
const amaka = new Person('Amaka');
const segun = new Person('Segun');
segun.setStingyMode(true);
const relationship = new Relationship(segun, amaka);
if (segun.isStingy() && relationship.isProblematic()) {
const breakupReason = "It's not working out.";
const breakup = new Breakup(breakupReason);
amaka.serve(segun, breakup);
}Person Class
The Person class represents a person in a relationship. You can use it to set stingy mode, serve actions, and check if the person is stingy.
const person = new Person('John');
person.setStingyMode(true);
person.serve(partner, action);
person.isStingy();Relationship Class
The Relationship class represents a relationship between two persons. You can use it to check if the relationship is problematic.
const relationship = new Relationship(person1, person2);
relationship.isProblematic();Breakup Class
The Breakup class represents a breakup action. You can create a breakup with a reason and access the reason and date of the breakup.
const breakupReason = "It's not working out.";
const breakup = new Breakup(breakupReason);
breakup.getReason();
breakup.getDate();