npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

feedback-colorful-formatter

v1.0.0

Published

A sentiment-based feedback formatter with colorful output using chalk

Readme

🎨 Feedback Colorful Formatter

A beautiful npm package that adds sentiment-based colorful formatting to feedback text using chalk. Perfect for CLI applications, feedback systems, and any Node.js project that needs intelligent text formatting.

✨ Features

  • 🎨 Sentiment-based color formatting - Automatically colors text based on emotional content
  • 📊 Sentiment scoring - Get numerical sentiment scores from -2 to 2
  • 😊 Emoji indicators - Add emoji representations for different sentiments
  • 🔍 Detailed analysis - Get comprehensive sentiment analysis reports
  • 🚀 Easy to use - Simple API with zero configuration

🛠 Installation

npm install feedback-colorful-formatter

📖 Usage

Basic Formatting

const { formatFeedback } = require('feedback-colorful-formatter');

// Positive feedback appears in green
console.log(formatFeedback("This is an excellent course!"));

// Negative feedback appears in red
console.log(formatFeedback("This course is terrible"));

// Neutral feedback appears in yellow
console.log(formatFeedback("The course covers basic topics"));

Sentiment Scoring

const { getSentimentScore } = require('feedback-colorful-formatter');

console.log(getSentimentScore("This is amazing!")); // 2 (very positive)
console.log(getSentimentScore("This is good"));     // 1 (positive) 
console.log(getSentimentScore("This is okay"));     // 0 (neutral)
console.log(getSentimentScore("This is bad"));      // -1 (negative)
console.log(getSentimentScore("This is terrible")); // -2 (very negative)

Emoji Enhancement

const { formatWithEmoji } = require('feedback-colorful-formatter');

console.log(formatWithEmoji("I love this course!")); // 😍 [green text]
console.log(formatWithEmoji("This is confusing"));   // 😕 [red text]

Detailed Analysis

const { analyzeFeedback } = require('feedback-colorful-formatter');

const analysis = analyzeFeedback("This course is absolutely fantastic!");

console.log(analysis);
// Output:
// {
//   originalText: "This course is absolutely fantastic!",
//   formattedText: "[green colored text]",
//   score: 2,
//   sentiment: "Very Positive", 
//   description: "This feedback indicates strong satisfaction",
//   withEmoji: "😍 [green colored text]"
// }

🎯 API Reference

formatFeedback(text)

Formats text with sentiment-based colors.

  • Parameters: text (string) - The feedback text to format
  • Returns: Colorfully formatted string using chalk
  • Colors: Red (negative), Green (positive), Blue (neutral keywords), Yellow (default)

getSentimentScore(text)

Analyzes text and returns numerical sentiment score.

  • Parameters: text (string) - The feedback text to analyze
  • Returns: Number from -2 to 2 representing sentiment intensity

formatWithEmoji(text)

Formats text with both colors and emoji indicators.

  • Parameters: text (string) - The feedback text to format
  • Returns: Formatted string with emoji prefix

analyzeFeedback(text)

Provides comprehensive sentiment analysis.

  • Parameters: text (string) - The feedback text to analyze
  • Returns: Object with detailed analysis including score, sentiment, and description

🔤 Sentiment Keywords

Very Positive: excellent, amazing, love, best, awesome, fantastic, perfect
Positive: good, great, helpful, clear, informative
Neutral: okay, average, fine, normal, standard, decent
Negative: bad, boring, poor, disappointing, confusing, difficult
Very Negative: terrible, awful, hate, worst, useless

🎨 Color Scheme

  • 🔴 Red Bold: Very negative sentiment
  • 🟢 Green Bold: Positive sentiment
  • 🔵 Blue: Neutral keywords
  • 🟡 Yellow: Default/unclassified text

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT License - feel free to use in your projects!

🏷 Tags

sentiment-analysis feedback cli chalk colors text-formatting nodejs npm-package