Reusable JavaScript & TypeScript Libraries
Exposing SopKit's core browser utility logic as lightweight, zero-dependency, strictly-typed packages. Easily integrate them into your own Node.js, frontend, or serverless workloads.
@sopkit/cli
An interactive, prompt-driven command-line interface to run any SopKit developer utility directly in your terminal.
npx @sopkit/cli
# Run directly without installation npx @sopkit/cli # Or install globally npm install -g @sopkit/cli sopkit
npx @sopkit/cliLaunch the interactive utility dashboard.
npm i -g @sopkit/cliInstall globally to enable the 'sopkit' terminal command.
@sopkit/base64
Full Unicode and URL-Safe Base64 encoder and decoder for both Browser and Node.js.
npm install @sopkit/base64
import { encode, decode, urlEncode, urlDecode } from "@sopkit/base64";
const encoded = encode("Hello World 🚀");
console.log(encoded); // "SGVsbG8gV29ybGQg8J+Zog=="
const decoded = decode(encoded);
console.log(decoded); // "Hello World 🚀"encode(input: string): stringEncodes string into standard Base64 representation (supports full UTF-8 Unicode).
decode(input: string): stringDecodes standard Base64 string back into original UTF-8 string.
urlEncode(input: string): stringEncodes into URL-safe Base64 representation (+ ➜ -, / ➜ _, strips =).
urlDecode(input: string): stringDecodes URL-safe Base64 representation.
isValid(input: string): booleanReturns true if the input is a valid Base64 string.
@sopkit/uuid
Cryptographically secure UUID v4 (random) and v1 (timestamp) generator and validator.
npm install @sopkit/uuid
import { v4, validate, getVersion } from "@sopkit/uuid";
const id = v4(); // "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"
console.log(validate(id)); // true
console.log(getVersion(id)); // 4v4(): stringGenerates a cryptographically secure random UUID v4.
v1(): stringGenerates a timestamp-based UUID v1.
validate(uuid: string): booleanValidates if the given string is a valid UUID structure.
getVersion(uuid: string): number | nullReturns the UUID version (1-5) or null if invalid.
@sopkit/slug
Accent-normalized, URL-safe multilingual slug generator for SEO and clean URLs.
npm install @sopkit/slug
import { slugify } from "@sopkit/slug";
const slug = slugify("Café & Résumé!", { separator: "-" });
console.log(slug); // "cafe-resume"slugify(text: string, options?: SlugOptions): stringGenerates a clean slug (decomposes accents/diacritics, lowercase, custom separators).
isValid(slug: string, separator?: string): booleanReturns true if string is a valid URL slug structure.
@sopkit/json
JSON syntax validator with line/column checks, pretty-formatting, and fast minification.
npm install @sopkit/json
import { format, minify, validate } from "@sopkit/json";
const raw = '{"name":"sopkit","status":true}';
const pretty = format(raw, { space: 4 });
console.log(pretty);validate(jsonStr: string): ValidationResultChecks JSON validity. Returns parsed data or detailed syntax errors (line, column).
format(jsonStr: string, options?: FormatOptions): stringFormats (beautifies) a JSON string with customizable spaces.
minify(jsonStr: string): stringMinifies a JSON string, stripping all whitespace.
@sopkit/color
High-performance colorspace conversion utility for HEX, RGB, and HSL formats.
npm install @sopkit/color
import { hexToRgb, rgbToHex } from "@sopkit/color";
const rgb = hexToRgb("#3b82f6"); // { r: 59, g: 130, b: 246 }
const hex = rgbToHex(59, 130, 246); // "#3b82f6"hexToRgb(hex: string): RGBConverts HEX color string (3 or 6 chars, with or without #) to RGB.
rgbToHex(r, g, b): stringConverts RGB component values (0-255) to a HEX string.
rgbToHsl(r, g, b): HSLConverts RGB component values to HSL components.
hslToRgb(h, s, l): RGBConverts HSL component values to RGB components.
@sopkit/validator
Premium, ultra-fast validation library for email, URLs, domains, IP addresses, credit cards, and MAC addresses.
npm install @sopkit/validator
import { isEmail, isCreditCard } from "@sopkit/validator";
isEmail("shaswatraj3@gmail.com"); // true
isCreditCard("49927398716"); // Luhn checksum checkisEmail(email: string): booleanValidates whether the string is a valid email according to RFC specifications.
isUrl(url: string): booleanReturns true if the string is a valid parseable URL link.
isDomain(domain: string): booleanValidates if the string is a valid domain structure.
isIp(ip: string): booleanChecks if the string is a valid IPv4 or IPv6 address.
isMacAddress(mac: string): booleanValidates MAC address format.
isCreditCard(cardNumber: string): booleanValidates credit cards using the Luhn checksum algorithm.
@sopkit/password
Premium, lightweight password generation and strength analysis library with shannon information entropy scoring.
npm install @sopkit/password
import { generate, analyze } from "@sopkit/password";
const pass = generate({ length: 16 });
const strength = analyze(pass);
console.log(strength.label); // "strong" or "very-strong"generate(options?: GeneratorOptions): stringGenerates a secure password based on customized constraints (length, symbols, digits).
analyze(password: string): StrengthResultGrades password strength (0-4 score), calculates bit entropy, and generates safety recommendations.
Why Choose @sopkit Over Alternatives?
A side-by-side comparison of SopKit packages against legacy industry standards.
| Feature | @sopkit Ecosystem | Legacy Standard Packages |
|---|---|---|
| Dependencies | 0 (Zero Bloat) | Varies (Often nests 3rd-party modules) |
| Bundle Size | Ultra-lightweight (< 2KB average) | Heavy (Often includes legacy Polyfills) |
| Build Formats | ESM & CommonJS (Dual-format native) | Often ESM-only or CJS-only |
| TypeScript Integration | 100% Strict types (.d.ts inline) | Requires separate @types/ install |
| Unicode / Multilingual | Full standard UTF-8 support built-in | Often breaks on emojis/special characters |
| Central CLI Control | Available via npx @sopkit/cli | Separate tools, inconsistent interfaces |