snapple-facts
Version:
Every Snapple Fact
123 lines (79 loc) • 7.9 kB
Markdown
<div align="center">
<h1><img src='./src/assets/Snapple_logo_(2020).png' width='50' height='30' align='center' alt='Snapple Logo' />
Snapple Facts
<img src='./src/assets/Snapple_logo_(2020).png' width='50' height='30' align='center' alt='Snapple Logo' />
</h1>
[](https://github.com/Vaporjawn/snapple-facts/actions/workflows/install.js.yml)
[](https://github.com/Vaporjawn/snapple-facts/actions/workflows/build.js.yml)
[](https://github.com/Vaporjawn/snapple-facts/actions/workflows/lint.js.yml)
[](https://github.com/Vaporjawn/snapple-facts/actions/workflows/tests.js.yml)
[](https://github.com/Vaporjawn/snapple-facts/actions/workflows/securityScan.yml)
[](https://github.com/Vaporjawn/snapple-facts/network) [](https://github.com/Vaporjawn/snapple-facts/stargazers) [](https://github.com/Vaporjawn/snapple-facts/graphs/contributors)[](https://github.com/sponsors/Vaporjawn) [](https://github.com/Vaporjawn/snapple-facts/watchers) [](https://github.com/Vaporjawn/snapple-facts/archive/refs/heads/main.zip)
[](https://www.typescriptlang.org/)    
</div>
## Usage
### Installation
```bash
npm install snapple-facts --save-dev
```
### Usage in Typescript
All the methods that you will need are available in this class
```typescript
import SnappleFacts from 'snapple-facts';
const snappleFacts = new SnappleFacts();
const randomFact: SnappleFact = snappleFacts.randomFact();
console.log(randomFact);
```
#### Available Methods
```typescript
snappleFacts.randomFact(): SnappleFact;
snappleFacts.getFacts(): SnappleFact[];
snappleFacts.listFacts(): string[];
snappleFacts.getFactByNumber(factNumber: number): SnappleFact | undefined;
```
### Functional Usage
```typescript
import { RandomFact, GetFacts, ListFacts, GetFactByNumber } from 'snapple-facts';
const randomFact: SnappleFact = RandomFact();
const facts: SnappleFact[] = GetFacts();
const factList: string[] = ListFacts();
const factByNumber: SnappleFact | undefined = GetFactByNumber(1);
```
## Technologies
<img alt="TypeScript" src="https://img.shields.io/badge/typescript-%233178C6.svg?style=for-the-badge&logo=typescript&logoColor=white"/><img alt="Prettier" src="https://img.shields.io/badge/prettier-%23F7B93E.svg?style=for-the-badge&logo=prettier&logoColor=white"/><img alt="ESLint" src="https://img.shields.io/badge/eslint-%234B32C3.svg?style=for-the-badge&logo=eslint&logoColor=white"/><img alt="Jest" src="https://img.shields.io/badge/jest-%23C21325.svg?style=for-the-badge&logo=jest&logoColor=white"/><img alt="NodeJS" src="https://img.shields.io/badge/nodejs-%23339933.svg?style=for-the-badge&logo=node.js&logoColor=white"/><img alt="NPM" src="https://img.shields.io/badge/npm-%23CB3837.svg?style=for-the-badge&logo=npm&logoColor=white"/>
## How To Contribute
Click on these badges to see how you might be able to help:
<div align="center" markdown="1">
[](https://github.com/Vaporjawn/snapple-facts/issues) [](https://github.com/Vaporjawn/snapple-facts/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) [](https://github.com/Vaporjawn/snapple-facts/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)[](https://github.com/Vaporjawn/snapple-facts/pulls) [](https://github.com/Vaporjawn/snapple-facts/pulls?q=is%3Apr+is%3Amerged) [](https://github.com/Vaporjawn/snapple-facts/pulls?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
</div>
### Installation
[](https://github.com/Vaporjawn/snapple-facts/actions/workflows/install.js.yml)
```bash
npm install
```
### Running
```bash
npm start
```
or
```bash
npm run dev
```
### Testing
[](https://github.com/Vaporjawn/snapple-facts/actions/workflows/tests.js.yml)
```bash
npm test
```
### Building
[](https://github.com/Vaporjawn/snapple-facts/actions/workflows/build.js.yml)
```bash
npm run build
```
## Thanks to all Contributors 💪
- **Thank you** for considering to contribute
- Feel free to submit feature requests, UI updates, bugs as issues.
- Checkout [Contribution Guidelines](https://github.com/Vaporjawn/snapple-facts/blob/master/CONTRIBUTING.md) for more information.
- Have a feature request? Feel free to create a issue for it.
[](https://github.com/Vaporjawn/snapple-facts/graphs/contributors)
## Your Support means a lot
Give a ⭐ to show support for the project.