Skip to content

Latest commit

 

History

History
55 lines (36 loc) · 1.82 KB

README.md

File metadata and controls

55 lines (36 loc) · 1.82 KB

ctree.js

Banner for ctree.js repo

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!

Features

  • 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.

Example and usage

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);

Acknowledgments

  • This library was originally written in GoLang by Matt Gleich.

Contributing GitHub

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.

License GitHub

This library is open-source and available under the MIT License. See the LICENSE file for more details.