UNPKG

code-mantras

Version:

Lightweight npm package delivering 100+ powerful, tech-focused motivational greetings to boost productivity for developers, and teams.

213 lines (148 loc) โ€ข 6.29 kB
# ๐Ÿš€ Code Mantras <div align="center"> **๐Ÿ’ก Daily dose of motivation for developers who code, create, and conquer!** *Transform your terminal into a source of inspiration with powerful mantras crafted for the modern developer.* </div> --- ## โœจ What is Code Mantras? Code Mantras delivers **100+ insperitional quotes** designed specifically for developers, programmers, and tech enthusiasts. Whether you're debugging at 3 AM, pushing through a challenging feature, or just need that extra spark of motivation, Code Mantras has got your back! ## ๐ŸŽฏ Features - ๐ŸŽฒ **100+ Unique Messages** - Never see the same motivation twice - ๐ŸŽจ **Personalized Greetings** - Add your name for a personal touch - โšก **Lightning Fast** - Zero dependencies, pure JavaScript magic - ๐ŸŒ **Universal** - Works everywhere: Node.js, browsers, terminals - ๐ŸŽญ **Smart Capitalization** - Automatically formats names beautifully - ๐Ÿ“ฆ **Tiny Bundle** - Lightweight and efficient ## ๐Ÿš€ Quick Start ### Installation ```bash # Or install from npm npm install code-mantras ``` ### Usage ```javascript import { greetings } from 'code-mantras'; // Get a random motivational message console.log(greetings()); // Output: "Code is poetry written in logic. Make yours a masterpiece!" // Add your name for personalization console.log(greetings('Alice')); // Output: "Every expert was once a beginner. Every pro was once an amateur. โ€” Alice" // Perfect for CLI tools console.log(greetings('john doe')); // Output: "Think twice, code once. Debug never! โ€” John Doe" ``` ## ๐ŸŽช Real-World Examples ### ๐Ÿ–ฅ๏ธ Terminal Greeting ```javascript // Add to your .zshrc or .bashrc import { greetings } from 'code-mantras'; console.log(`\n${greetings('YourName')}\n`); ``` ### ๐Ÿค– CLI Tool Integration ```javascript #!/usr/bin/env node import { greetings } from 'code-mantras'; console.log('๐Ÿš€ Starting development server...'); console.log(`๐Ÿ’ญ ${greetings()}`); // Your CLI logic here ``` ### ๐ŸŽฏ Build Scripts ```javascript // package.json { "scripts": { "start": "node -e \"import('code-mantras').then(m => console.log(m.greetings()))\" && your-start-command", "build": "node -e \"import('code-mantras').then(m => console.log(m.greetings()))\" && your-build-command" } } ``` ### ๐ŸŽจ React/Vue Apps ```javascript import { greetings } from 'code-mantras'; function WelcomeComponent() { const motivation = greetings('Developer'); return ( <div className="welcome-banner"> <h2>๐ŸŽฏ Daily Motivation</h2> <p>{motivation}</p> </div> ); } ``` ## ๐ŸŽญ Sample Messages Here's a taste of what Code Mantras delivers: > **"Code is poetry written in logic. Make yours a masterpiece!"** > **"Think twice, code once. Debug never!"** > **"Every expert was once a beginner. Every pro was once an amateur."** > **"Your code today is someone's inspiration tomorrow."** > **"Bugs are just features in disguise waiting to be discovered!"** *...and 95+ more inspiring messages!* ## ๐Ÿ› ๏ธ API Reference ### `greetings(userName?)` Returns a random motivational message with optional name personalization. **Parameters:** - `userName` (optional): String - Your name or any name to personalize the message **Returns:** - `String` - A formatted motivational message **Examples:** ```javascript greetings() // Returns: "Code is art. Make it beautiful!" greetings('Alice') // Returns: "Debug with patience, code with passion! โ€” Alice" greetings('bob joe') // Returns: "Think like a computer, dream like a human! โ€” Bob Joe" ``` ## ๐ŸŽฏ Use Cases - **๐Ÿ–ฅ๏ธ Terminal Startup Messages** - Motivate yourself every time you open the terminal - **๐Ÿค– CLI Tool Enhancement** - Add inspiration to your command-line applications - **๐Ÿ“ฑ Development Dashboards** - Display motivational quotes in your dev environment - **๐ŸŽฎ Coding Practice Apps** - Encourage learners with positive reinforcement - **๐Ÿš€ Build Scripts** - Make your build process more enjoyable - **๐Ÿ’ผ Team Tools** - Boost team morale in internal tools ## ๐Ÿงช Testing Code Mantras comes with comprehensive tests to ensure reliability: ```bash # Run tests npm test # Expected output โœ… Returns a string โœ… Includes name when provided โœ… Returns greeting without name โœ… Capitalizes names properly โœ… Returns different messages (randomness check) ``` ## ๐Ÿค Contributing We love contributions! Whether it's: - ๐Ÿ’ก **New motivational messages** - Add your favorite coding mantras - ๐Ÿ› **Bug fixes** - Help us squash those pesky bugs - ๐Ÿ“š **Documentation** - Improve our docs and examples - โœจ **Features** - Suggest new ways to motivate developers ### Quick Contribution Guide: 1. **Fork** the repository 2. **Create** a feature branch: `git checkout -b feature/amazing-mantras` 3. **Add** your motivational messages to `src/greetings.js` 4. **Test** your changes: `npm test` 5. **Commit** your changes: `git commit -m "Add amazing new mantras"` 6. **Push** to the branch: `git push origin feature/amazing-mantras` 7. **Open** a Pull Request ## ๐Ÿ“Š Stats & Performance - **โšก Bundle Size**: < 5KB minified - **๐Ÿš€ Load Time**: < 1ms average execution - **๐ŸŽฏ Zero Dependencies**: Pure JavaScript, no external deps - **๐ŸŒ Cross-Platform**: Works on Node.js 14+, all modern browsers - **๐Ÿ’พ Memory Usage**: < 1MB RAM footprint ## ๐Ÿ—บ๏ธ Roadmap - [ ] ๐ŸŒ **Multi-language Support** - Mantras in different languages - [ ] ๐ŸŽจ **Themed Collections** - Frontend, Backend, DevOps specific mantras - [ ] ๐Ÿ“… **Daily Mantra API** - Get date-specific motivational messages ## ๐Ÿ“œ License MIT License - feel free to use Code Mantras in your projects, commercial or personal! ## ๐Ÿ™ Acknowledgments - Inspired by developers worldwide who turn coffee into code โ˜• - Built with โค๏ธ for the coding community - Special thanks to all contributors who make this project awesome --- <div align="center"> **๐ŸŒŸ If Code Mantras inspired you, give it a star! ๐ŸŒŸ** Made with ๐Ÿ’ป and โ˜• for developers by developers [Report Bug](https://github.com/viveksojitra/code-mantras/issues) โ€ข [Request Feature](https://github.com/viveksojitra/code-mantras/issues) โ€ข [Documentation](https://github.com/viveksojitra/code-mantras#readme) </div>