{"_id":"@buureadline/buureadline","name":"@buureadline/buureadline","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@buureadline/buureadline","version":"1.0.0","description":"Colorful readline library with menu, question and choice functions for interactive CLI applications.","keywords":["readline","terminal","menu","interactive","buu-readline"],"author":{"name":"HonneyBuuModz"},"license":"MIT","main":"buuReadlineApi.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"dependencies":{},"peerDependencies":{"@buucolors/buucolors":"^1.0.0"},"peerDependenciesMeta":{"@buucolors/buucolors":{"optional":true}},"_id":"@buureadline/buureadline@1.0.0","_nodeVersion":"24.9.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-5TJ6+lQqi9UiDh58P2J6HFUwOWqTQ+7Olq6bUeKwHF56PXuzVw2ERgnGFQwnb8DTf6hZflDnmszaL5OAVFFuNw==","shasum":"3368129eaa53e3d60289060e20bda7d4aa1f90dd","tarball":"https://registry.npmjs.org/@buureadline/buureadline/-/buureadline-1.0.0.tgz","fileCount":3,"unpackedSize":19985,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBIlwTlp7jRaVJroSLKKgGQ4b9tinsddO/mA459Un9bqAiBmE5L9iXVixDAeP6gkz7kDmubQCDP28b0PRnCd+puN9w=="}]},"_npmUser":{"name":"honneybuu","email":"honneybuu.modz@gmail.com"},"directories":{},"maintainers":[{"name":"honneybuu","email":"honneybuu.modz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/buureadline_1.0.0_1762205361263_0.7901119919954571"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-03T21:29:21.165Z","1.0.0":"2025-11-03T21:29:21.494Z","modified":"2025-11-03T21:29:21.819Z"},"maintainers":[{"name":"honneybuu","email":"honneybuu.modz@gmail.com"}],"description":"Colorful readline library with menu, question and choice functions for interactive CLI applications.","keywords":["readline","terminal","menu","interactive","buu-readline"],"author":{"name":"HonneyBuuModz"},"license":"MIT","readme":"# <span style=\"color: #8A2BE2; text-shadow: 0 0 10px #DA70D6;\">BuuReadline</span>\n\n<div align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://img.shields.io/badge/Version-V1.0.0-ff6b6b?style=for-the-badge&logo=tag&logoColor=white&labelColor=1a1a1a\">\n    <img alt=\"Version\" src=\"https://img.shields.io/badge/Version-V1.0.0-ff6b6b?style=for-the-badge&logo=tag&logoColor=white&labelColor=1a1a1a\">\n  </picture>\n\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://img.shields.io/badge/Readline-Library-8A2BE2?style=for-the-badge&logo=javascript&logoColor=white&labelColor=1a1a1a\">\n    <img alt=\"BuuReadline\" src=\"https://img.shields.io/badge/Readline-Library-8A2BE2?style=for-the-badge&logo=javascript&logoColor=white&labelColor=1a1a1a\">\n  </picture>\n  \n  <a href=\"https://www.npmjs.com/~honneybuu\" target=\"_blank\">\n    <picture>\n      <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://img.shields.io/badge/NPM-Package-DA70D6?style=for-the-badge&logo=npm&logoColor=white&labelColor=1a1a1a\">\n      <img alt=\"NPM Package\" src=\"https://img.shields.io/badge/NPM-Package-DA70D6?style=for-the-badge&logo=npm&logoColor=white&labelColor=1a1a1a\">\n    </picture>\n  </a>\n\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://img.shields.io/badge/License-MIT-9370DB?style=for-the-badge&labelColor=1a1a1a\">\n    <img alt=\"License\" src=\"https://img.shields.io/badge/License-MIT-9370DB?style=for-the-badge&labelColor=1a1a1a\">\n  </picture>\n\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=white&labelColor=1a1a1a\">\n    <img alt=\"JavaScript Support\" src=\"https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=white&labelColor=1a1a1a\">\n  </picture>\n\n  <br><br>\n\n  <h2 style=\"color: #E6E6FA; text-shadow: 0 0 15px #8A2BE2;\">✨ Interactive CLI Readline Library ✨</h2>\n  <p style=\"color: #DDA0DD; font-size: 1.2em;\">Colorful readline library with menu, question and choice functions</p>\n</div>\n\n---\n\n## 🚀 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Features</span>\n\n<div style=\"background: linear-gradient(135deg, #1a1a1a 0%, #2d1b45 100%); padding: 20px; border-radius: 15px; border: 2px solid #8A2BE2; box-shadow: 0 0 20px #8A2BE280;\">\n\n- 🎨 *Optional Color Support* - Integrates with @buucolors/buucolors\n- 📋 *Interactive Menus* - Numbered selection options\n- ❓ *Simple Questions* - Promise-based input prompts\n- ✅ *Yes/No Queries* - German and English input support\n- 🎯 *Fallback System* - Works without color package\n- ⚡ *Lightweight* - Minimal dependencies\n- 🔗 *Simple API* - Intuitive methods\n- 🌈 *Automatic Color Detection* - Loads BuuColors automatically\n- 🚫 *Zero Dependencies* - Works standalone without any requirements\n\n</div>\n\n## 📦 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Installation</span>\n\n```bash\n# Basic installation (works standalone)\nnpm install @buureadline/buu-readline\n\n# With color support (recommended)\nnpm install @buureadline/buu-readline @buucolors/buucolors\n\n# Using yarn\nyarn add @buureadline/buu-readline @buucolors/buucolors\n\n# Using pnpm\npnpm add @buureadline/buu-readline @buucolors/buucolors\n```\n\n**Note:** BuuReadline works perfectly without any dependencies. Colors are automatically enabled if `@buucolors/buucolors` is installed, otherwise it falls back to plain text.\n\n## 💡 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Quick Start</span>\n\n```javascript\nconst { createBuuRl } = require('@buureadline/buu-readline');\n\n// Create readline interface (with automatic color detection)\nconst rl = createBuuRl();\n\nasync function quickDemo() {\n  // Simple question\n  const name = await rl.question('What is your name? ');\n  console.log(`Hello ${name}! 👋`);\n\n  // Interactive menu\n  const choice = await rl.menu('What would you like to do?', [\n    '📂 Open file',\n    '💾 Save file', \n    '🚪 Exit'\n  ]);\n  console.log(`You chose: ${choice}`);\n\n  // Yes/No question\n  const confirm = await rl.choose('Do you want to continue? (y/n): ');\n  console.log(confirm ? '✅ Let\\'s go!' : '❌ Cancelled.');\n\n  rl.close();\n}\n\nquickDemo();\n```\n\n## 🎨 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">With BuuColors (Recommended)</span>\n\n```javascript\nconst { createBuuRl } = require('@buureadline/buu-readline');\n\nconst rl = createBuuRl(); // Loads BuuColors automatically if available\n\nasync function colorfulExample() {\n  // Colorful input prompts\n  const project = await rl.question('🚀 Project name: ');\n  \n  // Colorful menu with options\n  const framework = await rl.menu('🛠️ Choose framework:', [\n    'React.js',\n    'Vue.js', \n    'Angular',\n    'Vanilla JS'\n  ]);\n  \n  // Confirmation with colors\n  const useTS = await rl.choose('📝 Use TypeScript? ');\n  \n  console.log(`\n🎉 Project Setup:\n📦 Name: ${project}\n⚡ Framework: ${framework} \n📘 TypeScript: ${useTS ? 'Yes' : 'No'}\n  `);\n  \n  rl.close();\n}\n\ncolorfulExample();\n```\n\n## 🔧 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Without BuuColors (Plaintext)</span>\n\nThe package works automatically without colors when `@buucolors/buucolors` is not installed:\n\n```javascript\nconst { createBuuRl } = require('@buureadline/buu-readline');\n\n// Works without BuuColors - uses plaintext\nconst rl = createBuuRl();\n\nasync function plaintextExample() {\n  const name = await rl.question('Enter name: ');\n  \n  const choice = await rl.menu('Select option:', [\n    'Option A',\n    'Option B', \n    'Option C'\n  ]);\n  \n  const confirm = await rl.choose('Confirm? (y/n): ');\n  \n  console.log(`Name: ${name}, Choice: ${choice}, Confirmed: ${confirm}`);\n  rl.close();\n}\n\nplaintextExample();\n```\n\n**Perfect for environments where:**\n- You don't want color dependencies\n- Running in CI/CD pipelines\n- Building lightweight CLI tools\n- Colors are not supported\n\n## 🎨 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Custom Colors</span>\n\nYou can define your own color functions:\n\n```javascript\nconst { createBuuRl } = require('@buureadline/buu-readline');\n\n// Custom color definitions\nconst customColors = {\n  gradientCmd_yellow2orange: Object.assign(\n    (text) => `\\x1b[38;5;214m${text}\\x1b[0m`, \n    { bold: (text) => `\\x1b[1;38;5;214m${text}\\x1b[0m` }\n  ),\n  cmdMagenta: Object.assign(\n    (text) => `\\x1b[35m${text}\\x1b[0m`,\n    { bold: (text) => `\\x1b[1;35m${text}\\x1b[0m` }\n  ),\n  cmdBrightMagenta: (text) => `\\x1b[95m${text}\\x1b[0m`,\n  cmdRed: (text) => `\\x1b[31m${text}\\x1b[0m`\n};\n\nconst rl = createBuuRl(customColors);\n\nasync function customColorExample() {\n  const answer = await rl.question('With custom colors: ');\n  console.log(`Input: ${answer}`);\n  rl.close();\n}\n\ncustomColorExample();\n```\n\n**Use cases for custom colors:**\n- Brand-specific color schemes\n- Terminal-specific optimizations\n- Custom styling requirements\n- Integration with other color libraries\n\n## 📋 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">API Reference</span>\n\n### `createBuuRl(buuColor?): BuuReadlineInterface`\n\nCreates a new readline instance with automatic color detection.\n\n```javascript\nconst { createBuuRl } = require('@buureadline/buu-readline');\n\n// Automatic color detection\nconst rl = createBuuRl();\n\n// With custom colors\nconst rl2 = createBuuRl(customColors);\n```\n\n### BuuReadlineInterface Methods\n\n#### `question(query): Promise<string>`\nAsks a simple question and waits for input.\n\n```javascript\nconst name = await rl.question('What is your name? ');\nconst email = await rl.question('📧 Email address: ');\n```\n\n#### `menu(query, options): Promise<string>`\nShows a numbered menu and returns the selected option.\n\n```javascript\nconst choice = await rl.menu('Choose framework:', [\n  'React.js',\n  'Vue.js',\n  'Angular'\n]);\n// Returns the selected option (e.g. \"React.js\")\n```\n\n#### `choose(query): Promise<boolean>`\nAsks a yes/no question with multilingual support.\n\n```javascript\nconst confirm = await rl.choose('Continue? (y/n): ');\n// true for: j, ja, y, yes\n// false for: n, nein, no\n```\n\n#### `close(): void`\nCloses the interface and frees resources.\n\n```javascript\nrl.close(); // Always call at the end\n```\n\n## ⚡ <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Advanced Features</span>\n\n<div style=\"background: linear-gradient(135deg, #1a1a1a 0%, #2d1b45 100%); padding: 20px; border-radius: 15px; border: 2px solid #8A2BE2; box-shadow: 0 0 20px #8A2BE280;\">\n\n- ✅ *JavaScript Compatible* - Fully compatible\n- ✅ *CommonJS Module* - Standard require() syntax\n- ✅ *Automatic Color Detection* - Loads BuuColors if available\n- ✅ *Fallback System* - Plaintext without color package\n- ✅ *Multilingual Input* - German and English for yes/no\n- ✅ *Promise-based* - Modern async/await syntax\n- ✅ *Robust Validation* - Safe input handling\n- ✅ *Lightweight* - Minimal overhead\n- ✅ *Zero Dependencies* - Works completely standalone\n\n</div>\n\n## 🔥 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Real-World Examples</span>\n\n### CLI Tool Setup Wizard\n```javascript\nconst { createBuuRl } = require('@buureadline/buu-readline');\n\nasync function setupWizard() {\n  const rl = createBuuRl();\n  \n  console.log('🎉 Setup wizard started!\\n');\n  \n  // Collect project information\n  const projectName = await rl.question('📦 Project name: ');\n  const description = await rl.question('📝 Description: ');\n  \n  // Select technology stack\n  const frontend = await rl.menu('🎨 Frontend framework:', [\n    'React.js',\n    'Vue.js', \n    'Angular',\n    'Svelte',\n    'Vanilla JS'\n  ]);\n  \n  const backend = await rl.menu('⚙️ Backend framework:', [\n    'Express.js',\n    'Fastify',\n    'Koa.js',\n    'NestJS',\n    'Frontend only'\n  ]);\n  \n  // Additional features\n  const useTS = await rl.choose('📘 Use TypeScript? ');\n  const useESLint = await rl.choose('🔍 Setup ESLint? ');\n  const usePrettier = await rl.choose('💄 Setup Prettier? ');\n  \n  // Summary\n  console.log('\\n✨ Project Configuration:');\n  console.log(`├─ 📦 Name: ${projectName}`);\n  console.log(`├─ 📝 Description: ${description}`);\n  console.log(`├─ 🎨 Frontend: ${frontend}`);\n  console.log(`├─ ⚙️ Backend: ${backend}`);\n  console.log(`├─ 📘 TypeScript: ${useTS ? 'Yes' : 'No'}`);\n  console.log(`├─ 🔍 ESLint: ${useESLint ? 'Yes' : 'No'}`);\n  console.log(`└─ 💄 Prettier: ${usePrettier ? 'Yes' : 'No'}`);\n  \n  const confirm = await rl.choose('\\n🚀 Create project? ');\n  console.log(confirm ? '✅ Creating project...' : '❌ Setup cancelled.');\n  \n  rl.close();\n}\n\nsetupWizard();\n```\n\n### Interactive CLI Menu System\n```javascript\nconst { createBuuRl } = require('@buureadline/buu-readline');\n\nasync function mainMenu() {\n  const rl = createBuuRl();\n  \n  while (true) {\n    console.clear();\n    console.log('🌟 Main Menu 🌟\\n');\n    \n    const action = await rl.menu('What would you like to do?', [\n      '📊 Show data',\n      '✏️ Edit data', \n      '🗑️ Delete data',\n      '⚙️ Settings',\n      '🚪 Exit'\n    ]);\n    \n    switch (action) {\n      case '📊 Show data':\n        await showData(rl);\n        break;\n      case '✏️ Edit data':\n        await editData(rl);\n        break;\n      case '🗑️ Delete data':\n        await deleteData(rl);\n        break;\n      case '⚙️ Settings':\n        await settings(rl);\n        break;\n      case '🚪 Exit':\n        const confirm = await rl.choose('Really exit? ');\n        if (confirm) {\n          console.log('👋 Goodbye!');\n          rl.close();\n          return;\n        }\n        break;\n    }\n    \n    await rl.question('\\n⏸️ Press Enter to continue...');\n  }\n}\n\nasync function showData(rl) {\n  console.log('\\n📊 Displaying data...');\n  // Data logic here\n}\n\nasync function editData(rl) {\n  const field = await rl.menu('Which field to edit?', [\n    'Name',\n    'Email',\n    'Phone'\n  ]);\n  const newValue = await rl.question(`New value for ${field}: `);\n  console.log(`✅ ${field} updated to \"${newValue}\".`);\n}\n\nasync function deleteData(rl) {\n  const confirm = await rl.choose('⚠️ Really delete data? ');\n  console.log(confirm ? '🗑️ Data deleted.' : '❌ Operation cancelled.');\n}\n\nasync function settings(rl) {\n  const setting = await rl.menu('Choose setting:', [\n    'Change language',\n    'Change theme',\n    'Back'\n  ]);\n  console.log(`⚙️ ${setting} selected.`);\n}\n\nmainMenu();\n```\n\n### Standalone Usage (No Dependencies)\n```javascript\nconst { createBuuRl } = require('@buureadline/buu-readline');\n\n// Works perfectly without any other packages installed\nasync function standaloneExample() {\n  const rl = createBuuRl(); // No colors, pure functionality\n  \n  console.log('This works without any dependencies!\\n');\n  \n  const name = await rl.question('Enter your name: ');\n  const age = await rl.question('Enter your age: ');\n  \n  const language = await rl.menu('Choose your preferred language:', [\n    'JavaScript',\n    'TypeScript',\n    'Python',\n    'Go',\n    'Rust'\n  ]);\n  \n  const isExperienced = await rl.choose('Are you an experienced developer? (y/n): ');\n  \n  console.log('\\n--- Profile Summary ---');\n  console.log(`Name: ${name}`);\n  console.log(`Age: ${age}`);\n  console.log(`Preferred Language: ${language}`);\n  console.log(`Experience Level: ${isExperienced ? 'Experienced' : 'Beginner'}`);\n  \n  rl.close();\n}\n\nstandaloneExample();\n```\n\n## 📋 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Package Contents</span>\n\n- 📃 `buuReadlineApi.js` - Main API file\n- 📖 `README.md` - This beautiful documentation\n- 📜 `package.json` - Package configuration\n\n## 🤝 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Contributing</span>\n\nWe welcome contributions! You can:\n\n- 🐛 Report bugs\n- 💡 Suggest new features  \n- 🔧 Submit improvements\n- 🌟 Rate and share the package\n\n## 🎯 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Use Cases</span>\n\n**Perfect for:**\n- 🛠️ CLI tool creation\n- � Interactive setup wizards\n- 🎮 Terminal-based games\n- 📊 Data collection scripts\n- ⚙️ Configuration managers\n- 🔧 Development tools\n- 📝 Survey applications\n- 🎨 Interactive demonstrations\n\n## 📄 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">License</span>\n\n<div style=\"background: linear-gradient(135deg, #1a1a1a 0%, #2d1b45 100%); padding: 15px; border-radius: 10px; border-left: 4px solid #9370DB;\">\n\n**MIT License** - Free and Open Source\n\nThis project is licensed under the MIT License, which means you are free to:\n- ✅ *Use* - Use this library in personal and commercial projects\n- ✅ *Modify* - Change and customize the code to fit your needs  \n- ✅ *Distribute* - Share and redistribute the library\n- ✅ *Private Use* - Use in private projects without restrictions\n- ✅ *Commercial Use* - Use in commercial applications and products\n\nThe only requirement is to include the original copyright notice and license terms.\n\n</div>\n\n## 🌐 <span style=\"color: #BA55D3; text-shadow: 0 0 8px #DA70D6;\">Connect with Us</span>\n\n<div align=\"center\">\n  <a href=\"https://whatsapp.com/channel/0029VaCABrQ0AgWFWiCXq13W\" target=\"_blank\">\n    <img src=\"https://img.shields.io/badge/WA_CHANNEL-25D366?style=for-the-badge&logo=whatsapp&logoColor=white&labelColor=1a1a1a\" alt=\"WhatsApp Channel\" />\n  </a>\n  \n  <a href=\"https://t.me/honneybuuclient\" target=\"_blank\">\n    <img src=\"https://img.shields.io/badge/TG_CHANNEL-0088CC?style=for-the-badge&logo=telegram&logoColor=white&labelColor=1a1a1a\" alt=\"Telegram Channel\" />\n  </a>\n\n  <a href=\"https://www.instagram.com/honneybuu.modz\" target=\"_blank\">\n    <img src=\"https://img.shields.io/badge/IG_ACCOUNT-E4405F?style=for-the-badge&logo=instagram&logoColor=white&labelColor=1a1a1a\" alt=\"Instagram Account\" />\n  </a>\n</div>\n\n---\n\n<div align=\"center\">\n  <p style=\"color: #DDA0DD; font-size: 1.1em;\">\n    Made with 💜 by <strong style=\"color: #E6E6FA; text-shadow: 0 0 10px #8A2BE2;\">HonneyBuuModz</strong>\n  </p>\n  \n  <p style=\"color: #BA55D3;\">\n    🌟 <em>If this project helped you, please consider giving it a star!</em> 🌟\n  </p>\n</div>\n\n<div align=\"center\">\n  <img src=\"https://img.shields.io/badge/Built_with-💜_and_🍁-8A2BE2?style=for-the-badge&labelColor=1a1a1a\" alt=\"Built with love and colors\" />\n</div>","readmeFilename":"README.md","_rev":"1-f9e31464e4dfd2ff44b573456c988d8c"}