@nopkt/devtools
v1.0.0
Published
Developer utility SDK: QR codes, email validation, IP geolocation, URL shortening, text utils — all from one package
Downloads
14
Maintainers
Readme
@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/devtoolsQuick 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("[email protected]");
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 stringbulk(items)— Generate up to 50 QR codes
EmailValidator
validate(email)— Check validity, MX records, disposable detectionbulk(emails)— Validate up to 100 emails
IPGeo
me()— Geolocate caller's IPlookup(ip)— Geolocate specific IPbulk(ips)— Look up 20 IPs
URLShortener
shorten(url, options?)— Create short URL with optional custom sluginfo(slug)— Get click analyticsbulk(urls)— Shorten up to 25 URLs
TextUtils
markdown(text)— Convert Markdown to HTMLhash(text, algo?)— SHA-256/SHA-1/MD5base64Encode(text)/base64Decode(text)slugify(text)— URL-friendly slugwordcount(text)— Word count + reading timeextractUrls(text)/extractEmails(text)
License
MIT
