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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tactfulai/common

v2.0.0

Published

Tactful features

Readme

Tactful Utils

Core Library that include Core Models, Functions and Communication way between micro services

Table Of Content:


Installation

npm install @tactful/utils --save

Considerations:

  • Minimal Node.js version is >= 14 (RedisSMQ is tested under current active LTS and maintenance LTS Node.js releases).
  • Minimal Redis server version is 2.6.12 (RedisSMQ is tested under Redis v2.6, v3, v4, v5, and v6).

Tactful Bus

1. Architecture

Tactful Bus Architecture


2. Configration

you can configure TactfulBus by using Iconfig Interface that you pass in getTactfulBus Method to get a tactfulBus Instance

**IConfig < Interface> **:

	broker: Broker;
    namespace: string;
    messageExpiration: number;
    client?: any;
    username?: string;
    password?: string;

    /**
     * IP address of the server.
     * @default 127.0.0.1
     */
    host?: string | undefined;
    /**
     * Port of the  server.
     * @default 6379
     */
    port?: number | undefined;
    /**
     * The UNIX socket string of the server.
     * @default null
     */
    path?: string | undefined;
    /**
     * The URL of the  server.\
     * Format:
     * [redis[s]:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]\
     * More info avaliable at [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis).
     * @default null
     */
    url?: string | undefined;

Paramters

  1. Broker: redis|kafka
  2. namespace: The Env Name : development if local and qa if QA Env and so on
    default : development

3. Topics

Tactful Topic Exchange

Tactful Bus based on Topic Message Exchange
The pattern of a topic exchange is a string which is composed of alphanumeric characters, including - and _ characters, that are separated by a .. The a.b.c.d topic pattern matches the following queues a.b.c.d, a.b.c.d.e, and a.b.c.d.e.f, but it does not match the a.b, a.b.c, or a.b.c.z queues.

Note: use lowercase names for all topics..no camelCase or PascalCase

Topic Nameing convension

  1. use essential event and add ServiceName at the end :

tactful.[event].[topic].[service]

  1. topic is optional

Example:

Channels Service Publish to channel_msg so Automation Service Listen on Topic channel_msg.automation and LivechatServer Service listen on Topic channel_msg.livechat ...etc

Tactful essential Events

  1. tactful.channel_msg
  2. tactful.msg_reply
  3. tactful.event
  4. tactful.parsed_msg

4. Usage

import { getTactfulBus } from "@tactful/utils";

//Setup configuration to connect with redis
let configuration = {};
configuration.broker = "redis";
configuration.password = "123456"
configuration.messageExpiration = 3600000;
configuration.namespace = "development"

const bus = getTactfulBus(configuration); // get tactful bus Instance 


//Message Handler Call back .. it'll be called when listen on Topic 
const messageHandler = (msg, cb) => {
    const payload = msg.getBody();
    console.log('Consume >>> Message payload', payload);
    cb(); // acknowledging the message
 };
 
 
bus.on('tactful.test.service1', messageHandler);     // Subscribe Listining to topic 

bus.startConsuming();   // start to consume from subscribed topics 

bus.publish("tactfull.test", {hello:"world"}); //publish message to Topic

Customer manager

    const valid = MessageLimit.mediaLimits(message);
    // message reject
    if(!valid){
        console.log(valid.message)
    }

5. Advanced Details

to get more details See Tactful Bus Refrence


Tactful Models

  • Tactful Message Message Message

  • Tactful Reply reply: text reply: text