UNPKG

pooptastic

Version:

The most unnecessarily majestic JavaScript library for analyzing, rating, and spiritually connecting with poop. ๐Ÿ’ฉ

56 lines (47 loc) โ€ข 1.48 kB
const poopEmojis = ['๐Ÿ’ฉ', '๐Ÿช ', '๐Ÿšฝ', '๐Ÿงป', '๐Ÿ˜ท', '๐Ÿคข']; function isPoop(input) { return typeof input === 'string' && input.includes('๐Ÿ’ฉ'); } function flushPoop() { console.log('๐Ÿšฝ Flushing...'); setTimeout(() => console.log('๐Ÿ’ฆ ๐Ÿ’จ *gurgle* ๐Ÿ’จ ๐Ÿ’ฆ'), 800); } function ratePoop() { const score = Math.floor(Math.random() * 11); // 0โ€“10 const comments = [ "Yikes.", "Could be worse.", "Smells artisanal.", "Frighteningly majestic.", "Legendary loaf." ]; return `${score}/10 โ€“ ${comments[score % comments.length]}`; } function poopEmoji() { return poopEmojis[Math.floor(Math.random() * poopEmojis.length)]; } function generatePoopName() { const adjectives = ['Stinky', 'Silent', 'Sneaky', 'Massive', 'Cheeky', 'Slippery']; const nouns = ['Plopper', 'Dumper', 'Nugget', 'Splashmaster', 'WipeHog', 'StainLord']; const adj = adjectives[Math.floor(Math.random() * adjectives.length)]; const noun = nouns[Math.floor(Math.random() * nouns.length)]; return `${adj} ${noun}`; } function getPoopFortune() { const fortunes = [ "He who smelt it, dealt it.", "Your next dump will be enlightening.", "Flush twice, it's a long way to the cafeteria.", "Beware the wet wipe illusion.", "Great poops require great fiber." ]; return fortunes[Math.floor(Math.random() * fortunes.length)]; } module.exports = { isPoop, flushPoop, ratePoop, poopEmoji, generatePoopName, getPoopFortune };