Free, open-source TypeScript libraries from Lacspace — a full Security Kit (AES, hashing, JWT, 2FA, passkeys, MFA, lockout), an SEO Kit (JSON-LD, sitemaps, robots, llms.txt, feeds), the WebKit / StockKit / MailKit toolkits, the platform SDK, plus Bikram Sambat dates, Nepal utilities and React hooks. Zero dependencies, isomorphic, fully typed.
$ npm install @lacspace/sdk*No third-party runtime dependencies. A few packages build on another @lacspace package.
Talk to the Lacspace platform from any JavaScript runtime.
The all-in-one client · api · auth · analytics
Bundles api + auth + analytics behind one client that shares a single connection — a login token instantly applies everywhere — plus e-commerce helpers. Start here.
$ npm install @lacspace/sdkZero-dependency HTTP client · zero dependencies
The foundation everything is built on. Typed requests, predictable errors, automatic retries with backoff, request/response interceptors, query params, in-flight de-duping, response caching and cursor pagination — built on the platform fetch. A tiny axios / ky alternative that runs on Node, browsers, edge and React Native.
$ npm install @lacspace/apiAuthentication flows · built on @lacspace/api
Login, register, current user, logout and token refresh — with the bearer token applied automatically after sign-in. Plus auto-refresh (401 → refresh → retry, deduped), pluggable token storage (memory / localStorage) and auth-change subscriptions.
$ npm install @lacspace/authThe suite that powers StockYatra. Everything a trading, charting or algo app re-implements — done once, done right.
Streaming technical indicators · zero dependencies
RSI, MACD, EMA, Bollinger, ATR, VWAP, Stochastic, Supertrend, ADX — with an incremental O(1) API. Push one live LTP tick and the indicator updates without recomputing the whole series. Plus a tick→OHLC candle aggregator and candlestick pattern detection (doji, hammer, engulfing, harami…).
$ npm install @lacspace/indicatorsMoney & mechanics · zero dependencies
P&L, returns, CAGR, XIRR, position sizing, tick-size rounding and circuit limits — plus a real Indian brokerage & charges calculator (STT, GST, SEBI, stamp) with discount-broker presets. Now with Black-Scholes options pricing & greeks, implied volatility, and portfolio analytics (Sharpe, Sortino, max drawdown).
$ npm install @lacspace/marketTrading hours & holidays · zero dependencies
Is the market open right now? When does it next open or close? A holiday-aware, timezone-correct trading clock with NSE/BSE presets — or bring your own exchange spec.
$ npm install @lacspace/market-clockPaper-trading engine · zero dependencies
The simulator core behind StockYatra. A virtual wallet, market/limit/stop orders that fill against live prices, positions, holdings and live mark-to-market P&L. Now with a per-fill charges hook (pair it with @lacspace/market for net P&L) and backtest-style stats — win rate, profit factor, avg win/loss. Drop it into any app.
$ npm install @lacspace/paper-tradeEverything a backend needs to send, compose and validate email. Send with one line; compose bulletproof HTML; catch bad addresses before they cost you.
Zero-dependency SMTP client · zero dependencies · Node
Send email over raw Node net/tls — STARTTLS, AUTH, MIME with attachments — with no npm dependencies. Provider presets make Hostinger, Gmail, Outlook, Zoho & more a one-liner. Node only.
$ npm install @lacspace/mailerResponsive HTML emails · zero dependencies
Compose bulletproof, dark-mode-aware HTML emails from simple blocks (button, OTP code, invoice table) — no more <table> soup. Ships OTP/welcome/alert/invoice templates. A tiny MJML alternative.
$ npm install @lacspace/email-templatesValidation beyond regex · zero dependencies
Syntax + disposable/temp-mail detection, role & free-provider flags, Gmail normalization, and 'did you mean?' typo suggestions (gmial.com → gmail.com). Store the normalized form to de-dupe users.
$ npm install @lacspace/email-validateDeliverability checks · MX + SMTP · Node
Resolve a domain's MX records and optionally run a real SMTP RCPT probe to check a mailbox exists — without sending anything. Best-effort (servers greylist/catch-all), great for catching dead domains. Node only.
$ npm install @lacspace/email-verifyGenerate every file and tag search engines and AI crawlers look for — metadata, JSON-LD, sitemaps, robots.txt, llms.txt, feeds and more. All typed and dependency-free.
Metadata & JSON-LD · zero dependencies
16 schema.org JSON-LD builders (Organization, Article, Product, FAQ, LocalBusiness, Event, JobPosting, Recipe…), a @graph composer, a breadcrumb-from-path helper and a metadata linter — plus a rich Next.js Metadata helper with OpenGraph, Twitter and hreflang. Typed one-liners instead of fragile hand-written structured data.
$ npm install @lacspace/seositemap.xml + index · zero dependencies
URL entries with lastmod/changefreq/priority, image/video/news extensions and hreflang alternates. Auto-splits past 50,000 URLs into an index. Emits XML and Next.js sitemap.ts objects.
$ npm install @lacspace/sitemaprobots.txt + AI blocking · zero dependencies
Typed per-user-agent rules, sitemap refs, a parser, framework presets (Next.js, WordPress, Shopify) and an isAllowed() crawlability matcher — plus a one-liner to block AI crawlers (GPTBot, ClaudeBot, CCBot, Google-Extended and 14 more).
$ npm install @lacspace/robotsllms.txt / llms-full.txt · zero dependencies
Generate and parse llms.txt and llms-full.txt — the emerging llmstxt.org standard that gives LLMs a curated, Markdown map of your site — or build one straight from your sitemap entries. The SEO layer for the AI era.
$ npm install @lacspace/llms-txtSearch-engine verification · zero dependencies
Verification meta tags, Next.js verification metadata and file tokens for Google Search Console, Bing Webmaster, Yandex, Baidu, Pinterest, Ahrefs, Facebook and more — no more hunting for the right meta name.
$ npm install @lacspace/site-verifyRSS / Atom / JSON feeds · zero dependencies
Define your feed and items once, emit valid RSS 2.0, Atom 1.0 or JSON Feed 1.1 — with CDATA content, categories, authors and podcast enclosures. Great for blogs, changelogs and news.
$ npm install @lacspace/rssSEO URL slugs · zero dependencies
Turn any text into a clean, SEO-friendly URL slug — transliterates diacritics, collapses separators, truncates on word boundaries, and guarantees uniqueness against an existing set.
$ npm install @lacspace/slugifyReal security primitives built on vetted crypto (Web Crypto — never hand-rolled): AES, password hashing, tokens, API keys, 2FA/3FA, passkeys, account lockout, hardened headers and log redaction. For web, backend, mobile, AWS/S3 and Mongo.
AES-256-GCM encryption · zero dependencies · isomorphic
Authenticated AES-256-GCM encrypt/decrypt (with AAD), PBKDF2 & HKDF key derivation, SHA-2, HMAC, secure random and constant-time compare — a thin, correct layer over Web Crypto. Plus a versioned Keyring for envelope encryption & key rotation. Encrypt Mongo fields, S3 payloads and cookies.
$ npm install @lacspace/cryptoPassword hashing · zero dependencies · isomorphic
Hash & verify with PBKDF2-HMAC-SHA256 (600k iterations per OWASP) in a portable PHC string, constant-time verify, rehash detection and a strength estimator. Never store plaintext.
$ npm install @lacspace/passwordJWTs & tokens · zero dependencies · isomorphic
Sign & verify JWTs — symmetric HS256/384/512 and asymmetric RS256/ES256 — with strict expiry/issuer/audience checks over Web Crypto, so it runs on edge and workers. Plus remote JWKS verification, refresh-token rotation with reuse detection, and opaque & CSRF tokens. A tiny jose alternative.
$ npm install @lacspace/jwtAPI keys · zero dependencies · isomorphic
Issue prefixed, high-entropy keys (lac_live_…), store only the SHA-256 hash, show the last 4, and verify in constant time — exactly how Stripe/GitHub-style keys work.
$ npm install @lacspace/apikeyTOTP / HOTP 2FA · zero dependencies · isomorphic
Google Authenticator-compatible two-factor auth over Web Crypto — runs on Node, edge and browser. Generate secrets, verify codes with drift tolerance and replay protection, build otpauth:// URIs, and issue single-use hashed backup/recovery codes. A tiny speakeasy alternative, verified against the RFC test vectors.
$ npm install @lacspace/otpPasskeys / biometric · zero dependencies · isomorphic
FaceID, fingerprint and security keys via WebAuthn — browser ceremony helpers plus server challenge, options and real ES256/RS256 assertion verification (CBOR/COSE parse, DER handling) over Web Crypto.
$ npm install @lacspace/webauthn2FA / 3FA orchestration · zero dependencies · isomorphic
Combine password + TOTP + passkey into 2FA/3FA step-up flows with NIST assurance levels (AAL1–3). Track which factors are cleared and decide when a policy is satisfied.
$ npm install @lacspace/mfaAccount lockout · zero dependencies · isomorphic
Server-side brute-force protection: track failed attempts per user/IP, lock after N strikes with exponential backoff, auto-expire the window, reset on success. Pluggable store (Redis-ready).
$ npm install @lacspace/lockSecure headers + CSP · zero dependencies · isomorphic
A tiny framework-agnostic Helmet: strict security response headers (HSTS, X-Frame-Options, Referrer-Policy, COOP) and a typed Content-Security-Policy builder. Works everywhere + Next.js.
$ npm install @lacspace/headersLog redaction · zero dependencies · isomorphic
Mask secrets & PII before they reach your logs — by sensitive key name (password, token, authorization…) and by pattern (JWTs, API keys, emails, cards, IPs). Deep, on strings and objects.
$ npm install @lacspace/redactThe utilities every web app and backend re-implements — config, rate limiting and Next.js — done once, typed, and dependency-free.
Typed env variables · zero dependencies
Declare a schema, validate process.env once at boot, and get a typed frozen object. Missing or malformed vars throw one clear error before the app serves traffic. A zero-dep t3-env / envalid alternative.
$ npm install @lacspace/envRate limiting · zero dependencies
Fixed-window, sliding-window and token-bucket algorithms over a pluggable store (in-memory built in; bring your own Redis). Standard RateLimit-* headers. Drop into any API route, middleware or edge function.
$ npm install @lacspace/rate-limitNext.js App Router integration · built on @lacspace/sdk
The server-side companion to @lacspace/react: an authenticated SDK client from cookies, Route Handler & Server Action wrappers, cookie helpers, a one-line middleware auth guard and double-submit CSRF protection. Next.js 14 & 15.
$ npm install @lacspace/nextBatteries-included helpers for building Nepal-facing apps.
Bikram Sambat ↔ Gregorian · zero dependencies
Convert between BS and AD dates with Devanagari formatting. Range BS 1970–2086, cross-checked against established datasets across 42,000+ conversions.
$ npm install @lacspace/nepali-dateEveryday Nepal helpers · zero dependencies
NPR currency formatting (lakh/crore grouping), Devanagari numerals, amount-in-words for invoices, phone carrier detection & validators, all 77 districts by province, and a land-area converter (ropani-aana-paisa ↔ bigha-kattha-dhur ↔ m²/ft²).
$ npm install @lacspace/nepali-utilsThe packages are small on purpose — they get powerful when you combine them. No config files, no interactive prompts, no import-time surprises. Just import and go.
import { verify } from "@lacspace/password";
import { verifyTotp } from "@lacspace/otp";
import { sign } from "@lacspace/jwt";
import { lockout } from "@lacspace/lock";
const guard = lockout({ maxAttempts: 5, baseDelayMs: 60_000 });
async function login(email: string, pw: string, code: string) {
if ((await guard.check(email)).locked) throw new Error("Too many attempts");
const user = await db.users.findOne({ email });
const okPw = user && (await verify(pw, user.passwordHash));
const ok2fa = okPw && (await verifyTotp(code, user.totpSecret)) !== null;
if (!ok2fa) { await guard.record(email); throw new Error("Invalid credentials"); }
await guard.reset(email);
return sign({ sub: user.id, role: user.role }, process.env.JWT_SECRET!, { expiresIn: 3600 });
}import { encrypt, decrypt } from "@lacspace/crypto";
import { redact } from "@lacspace/redact";
const KEY = process.env.DATA_KEY!; // 256-bit base64url key
// store encrypted — authenticated AES-256-GCM
await db.users.updateOne({ _id }, { $set: { pan: await encrypt(pan, KEY) } });
// read it back
const pan = await decrypt(user.pan, KEY);
// never leak secrets into logs
logger.info(redact({ user: user.email, token, pan })); // → maskedimport { seoMetadata, article, jsonLd } from "@lacspace/seo";
import { toNextSitemap } from "@lacspace/sitemap";
// app/blog/[slug]/page.tsx
export const metadata = seoMetadata({
title: post.title, description: post.excerpt,
canonical: `/blog/${post.slug}`, image: post.cover, baseUrl: "https://site.com",
});
const schema = article({ headline: post.title, author: "Lumi AI", datePublished: post.date });
// <script type="application/ld+json">{jsonLd(schema)}</script>
// app/sitemap.ts
export default () => toNextSitemap(posts.map((p) => ({ loc: `https://site.com/blog/${p.slug}` })));import { RSI } from "@lacspace/indicators";
import { charges } from "@lacspace/market";
import { MarketClock, NSE } from "@lacspace/market-clock";
const rsi = new RSI(14);
socket.on("ltp", (price) => {
const value = rsi.next(price); // O(1) per tick — no array recompute
if (value !== null && value > 70) flag("overbought", value);
});
new MarketClock(NSE).isOpen(); // is NSE trading right now?
charges({ segment: "intraday", buy: 100, sell: 102, qty: 500 }).netPnl; // 946.34Whether you're hardening an API, doing on-page SEO, building a trading screen or a Nepal-facing app, it's the same story: import a tiny, typed function, get a correct result. Written against standard web APIs, so the same code runs across every JavaScript runtime.

The same standards we hold our own products to — applied to the tools we give away.
The core packages ship with no runtime dependencies — built on the platform fetch. Your node_modules stays tiny and your supply chain stays clean.
The same code runs on a server, in a browser, on the edge, or in React Native. No polyfills, no environment branching.
Full TypeScript definitions, shipped as both ESM and CommonJS with a proper exports map. Great DX in any modern toolchain.
Published under the Lacspace Free Licence — MIT-equivalent freedoms. Use them in personal and commercial projects, no strings attached.
Everything you'd want to know before adding an @lacspace package.
Yes — the packages have no third-party runtime dependencies. A few build on another Lacspace package (for example @lacspace/password uses @lacspace/crypto, and the security packages use the platform's Web Crypto), but there are no external npm dependencies pulled into your node_modules. That keeps installs tiny and your supply chain clean.
Most do. The packages are isomorphic — written against standard web APIs like fetch and Web Crypto — so the same code runs on Node 18+, in browsers, on edge runtimes and workers, and in React Native. A few are server-only by nature (for example @lacspace/mailer and @lacspace/email-verify open TCP sockets, and @lacspace/next targets the Next.js server); each README states its runtime clearly.
No hand-rolled crypto. The Security Kit is a thin, correct layer over the Web Crypto API — AES-256-GCM, PBKDF2, HMAC, ECDSA/RSA verification. We test against known vectors (for example TOTP against RFC 6238 and SHA-256 against the NIST test vector) before every release.
Yes. Every package is published under the Lacspace Free Licence — a free, permissive licence with MIT-equivalent freedoms — so you can use them in personal and commercial projects with no strings attached. Read the full licence at lacspace.com/licenses. (Lacspace's products are proprietary; the npm packages are the part we give away.)
Install with your package manager of choice — npm install @lacspace/<name>, or pnpm/yarn/bun. Every package ships full TypeScript definitions and is published as both ESM and CommonJS with a proper exports map, so it works in any modern toolchain with editor autocomplete out of the box.
All 35 packages live in one open monorepo at github.com/lacspace/npm-packages under the Lacspace Free Licence. Issues and pull requests are welcome — and if there's a package you wish existed, open an issue and tell us.
A free, permissive licence with MIT-equivalent freedoms — one licence for every open Lacspace package, across every language. Use it in personal and commercial projects at no cost.
All the source lives in one open monorepo. Issues and pull requests welcome — and if there's a package you wish existed, tell us.