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

luci-utils-tejpal

v1.0.1

Published

Luci utility functions - formatList, jwtDecode and more

Readme

luci-utils

Tejpal Singh

📦 Install

# Local project mein use karne ke liye
npm install ../luci\ Edtior

# Ya npm publish karne ke baad
npm install luci-utils

🚀 Usage

// CommonJS (Node.js)
const { formatList, jwtDecode } = require("luci-utils");

// ES Module (React/Next.js)
import { formatList, jwtDecode } from "luci-utils";

📝 formatList(text, options?)

HTML ya plain text ko display ke liye format karta hai. Chat messages, comments, descriptions ke liye best.

import { formatList } from "luci-utils";

// Basic use
const html = formatList("<p>Hello <span data-id='user1'>@Tejpal</span></p>");

// Custom userId pass karo
const html = formatList(text, { currentUserId: "user123" });

React / Next.js Use (dangerouslySetInnerHTML)

Kyunki formatList proper HTML tags return karta hai, isliye React mein directly {formatList(text)} likhne se waisa hi text dikhega. Ise proper render karne ke liye dangerouslySetInnerHTML use karein:

import { formatList } from "luci-utils"; // (ya aapka npm package name luci-utils-tejpal)

export default function TaskCard({ task }) {
  return (
    <div 
      className="prose list-disc subtext-1-weight-medium list-inside pl-0 space-y-1 max-w-full break-words"
      dangerouslySetInnerHTML={{ __html: formatList(task.Task) }}
    />
  );
}

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | currentUserId | string | auto (from token) | Logged-in user ka ID | | mentionColor | string | #5D56BD | Dusron ke mention ka color | | selfMentionColor | string | #FAA307 | Apne aap ke mention ka color |

Features

  • ✅ Images & documents remove karta hai
  • ✅ Mentions highlight karta hai
  • ✅ URLs ko clickable links banata hai
  • ✅ Lists aur paragraphs style karta hai
  • ✅ Plain text ko HTML mein convert karta hai

🔐 jwtDecode(token)

JWT token decode karta hai bina kisi external package ke!

import { jwtDecode } from "luci-utils";

const token = localStorage.getItem("token");
const decoded = jwtDecode(token);
console.log(decoded.id);    // user ID
console.log(decoded.email); // email

🔍 getTokenField(token, field)

Token se specific field nikalta hai.

import { getTokenField } from "luci-utils";

const userId = getTokenField(token, "id");
const email = getTokenField(token, "email");

⏰ isTokenExpired(token)

Check karta hai ki token expire ho gaya hai ya nahi.

import { isTokenExpired } from "luci-utils";

if (isTokenExpired(token)) {
  // Redirect to login
}

🧪 Test Run

node test.js

Author

Tejpal Singh - luci-utils v1.0.0