Skip to content

generate some random fruits that works anywhere! πŸŽ²πŸ‰πŸπŸŽ‰

License

Notifications You must be signed in to change notification settings

open-benthic/random-fruits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Random Fruits Generator 🎲🍍

Random Fruits is a simple javascript library that generates some random fruits and it could be used in both browser and nodejs enviroments.

Installation

install via node :

$ npm i random-fruits

# Or if you use Yarn
$ yarn add random-fruits

You can also use this library on the browser directly:

<!-- For development -->
<script src="https://unpkg.com/random-fruits/dist/random-fruits.umd.js"></script>

<!-- Minified version for production -->
<script src="https://unpkg.com/random-fruits/dist/random-fruits.umd.min.js"></script>

Quick Start

On Node.js:

const randomFruits = require('random-fruits');

randomFruits.roll(); // "πŸ‰"

randomFruits.rollThree(); // "πŸ‡,🍍,πŸ‹"

If you load the umd bundle on the browser, you can access the randomFruit function globally :

window.randomFruit.roll(); // "🍏"

// Or simply
randomFruit.roll();

randomFruit.rollThree();

you can use import syntax either :

import { roll, rollThree } from 'random-fruits';

roll(); // 🍍

rollThree(); // πŸ₯­,πŸ“,🍌

Tech stack

Notes

supported enviroments :

last 2 version
> 5%
not dead
maintained node versions

uses rollup for ES Modules bundling and babel for coverting es2015+ code to es5.

also uses node-resolve plugin to compile cjs code to es module compatible ones for tree-shaking purposes done automatically by rollup.

lodash can be used as peer dependency.

Contributing

contributers welcomed here! πŸ˜€πŸ™Œ you can easily fork this project , add your changes and create pull request .

Roadmap

  • typescript support
  • tests
  • fruits slot machine
  • roll returns fruits as much as you want
  • dockerfiles
  • reduce project bundle size
  • UI component for react
  • create a blog post on DEV.to or Medium
  • animations
  • random-emojis

Helpful Links

wesbos - javascript modules bundling your javascript library with rollup

License

developed and maintained under MIT license Β© Benthic