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 --> <!-- Minified version for production -->
Quick Start
On Node.js:
const randomFruits = ; randomFruits; // "🍉" randomFruits; // "🍇,🍍,🍋"
If you load the umd
bundle on the browser, you can access the randomFruit
function globally :
windowrandomFruit; // "🍏" // Or simplyrandomFruit; randomFruit;
you can use import
syntax either :
; ; // 🍍 ; // 🥭,🍓,🍌
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
Helpful Links
wesbos - javascript modules bundling your javascript library with rollup
License
developed and maintained under MIT license © Benthic