A lightweight JavaScript library that generates a festive, colored Christmas tree using ANSI escape codes for terminal output.
Perfect for adding some holiday cheer to your command-line interface!
- Generates a festive Christmas tree directly in the terminal.
- Adds vibrant colors using ANSI escape codes for a visually appealing output.
- Randomly assigns colors to the tree's ornaments for a unique design every time.
How to use ctree.js:
import ctree from 'https://esm.sh/gh/MarketingPipeline/ctree.js/';
console.log(ctree()) // Returns the tree in your console output.
Another example:
import ctree from 'https://esm.sh/gh/MarketingPipeline/ctree.js/';
// Example function to repeatedly log the colored tree
function logTree() {
console.clear(); // Clear the console
console.log(ctree()); // Returns the tree in your console output
}
// Call logTree every 3 seconds (3000 milliseconds)
setInterval(logTree, 3000);
- This library was originally written in GoLang by Matt Gleich.
Contributions are welcome! If you have suggestions for improvements or features, feel free to create a pull request.
See also the list of contributors who participate in this project.
This library is open-source and available under the MIT License. See the LICENSE file for more details.