Skip to content

NoPKT/devtools-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@nopkt/devtools

A lightweight TypeScript SDK for common developer utilities: QR codes, email validation, IP geolocation, URL shortening, and text processing.

Zero dependencies. Works in Node.js, Deno, Bun, and edge runtimes.

Install

npm install @nopkt/devtools

Quick Start

import { DevTools } from "@nopkt/devtools";

const tools = new DevTools();

// Generate a QR code
const qr = await tools.qrcode.generate("https://example.com", { format: "svg" });

// Validate an email
const result = await tools.email.validate("user@example.com");
console.log(result.valid, result.disposable);

// IP geolocation
const geo = await tools.ip.lookup("8.8.8.8");
console.log(geo.country, geo.city);

// Shorten a URL
const short = await tools.url.shorten("https://example.com/very/long/path");
console.log(short.shortUrl);

// Text utilities
const { html } = await tools.text.markdown("# Hello World");
const { hash } = await tools.text.hash("secret", "sha256");

Individual Modules

Use only what you need:

import { QRCode, EmailValidator, IPGeo } from "@nopkt/devtools";

const qr = new QRCode("https://qrcode-api.gps949.workers.dev");
const email = new EmailValidator("https://email-validator-api.gps949.workers.dev");
const ip = new IPGeo("https://ip-geo-api.gps949.workers.dev");

API Reference

QRCode

  • generate(text, options?) — Generate QR code (svg/png/base64/matrix)
  • svg(text, options?) — Get raw SVG string
  • bulk(items) — Generate up to 50 QR codes

EmailValidator

  • validate(email) — Check validity, MX records, disposable detection
  • bulk(emails) — Validate up to 100 emails

IPGeo

  • me() — Geolocate caller's IP
  • lookup(ip) — Geolocate specific IP
  • bulk(ips) — Look up 20 IPs

URLShortener

  • shorten(url, options?) — Create short URL with optional custom slug
  • info(slug) — Get click analytics
  • bulk(urls) — Shorten up to 25 URLs

TextUtils

  • markdown(text) — Convert Markdown to HTML
  • hash(text, algo?) — SHA-256/SHA-1/MD5
  • base64Encode(text) / base64Decode(text)
  • slugify(text) — URL-friendly slug
  • wordcount(text) — Word count + reading time
  • extractUrls(text) / extractEmails(text)

License

MIT

About

Developer utility SDK: QR codes, email validation, IP geolocation, URL shortening, text utils

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors