1.0.0 • Published 1 year ago

tea-noni v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Tea-Noni Example Project

This is a simple Node.js project demonstrating how to use the tea-noni package to fetch information about teas and noni fruit.

Table of Contents

Installation

To use this project, you'll need to have Node.js installed. Then, follow these steps:

  1. Clone the repository (if it's in a repository) or download the code files.
  2. Open a terminal in the project directory.
  3. Install the required npm package by running:

    npm install tea-noni

Usage

After installing the necessary package, you can run the project to see how it works.

  1. Ensure you are in the project directory.
  2. Run the index.js file using Node.js:

    node index.js

This will execute the script and display information about green tea and noni fruit.

Example Code

Here's the main code from index.js:

// index.js

// Import the tea-noni module
const teaNoni = require('tea-noni');

// Function to display information about a specific tea
function displayTeaInfo(teaName) {
  teaNoni.getTeaInfo(teaName)
    .then(info => {
      console.log(`Information about ${teaName}:`);
      console.log(info);
    })
    .catch(error => {
      console.error(`Error fetching tea information: ${error.message}`);
    });
}

// Function to display information about noni fruit
function displayNoniInfo() {
  teaNoni.getNoniInfo()
    .then(info => {
      console.log('Information about Noni Fruit:');
      console.log(info);
    })
    .catch(error => {
      console.error(`Error fetching noni fruit information: ${error.message}`);
    });
}

// Example: Display information about green tea
displayTeaInfo('Green Tea');

// Example: Display information about noni fruit
displayNoniInfo();