Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more

πŸ¦₯ Sloth

Deno module License CI Docs Coverage

Sloth is a modular Deno library designed to be lightweight, flexible, and adaptable for any environment: 🌐 REST APIs, πŸ› οΈ low-level utilities, βš™οΈ KV management, πŸ”’ middlewares, and much more.


πŸš€ Why Sloth?

βœ… Pick only what you need β†’ no bulky global mod.ts entry. βœ… Environment- and feature-organized β†’ clean separation by platform (deno, node) and domain (kv, utils, rest, …). βœ… Strict TypeScript β†’ full typings, safe autocompletion, fewer runtime surprises. βœ… Minimal by design β†’ no unnecessary bloat, no hidden dependencies.


πŸ“¦ Installation

Sloth does not expose a global mod.ts. Instead, import only the modules you want:


πŸ—οΈ Project Structure

Folder Purpose
src/deno Deno-specific modules (KV, .env helpers, system tools)
src/utils Pure utilities (merge, clone, type helpers)
src/apps Reusable app stacks (REST, WebSocket, CLI scaffolds)
tests/ Full test suite, unit + integration
(no mod.ts) Modules are standalone, import them individually

πŸ”§ Code Examples

βœ… Typed Deno KV slot

import { KvSlot } from 'https://deno.land/x/sloth@<version>/src/deno/kv/slot.class.ts'
import { z } from 'https://deno.land/x/zod/mod.ts'

const userSlot = new KvSlot('users', z.object({
  id: z.string(),
  name: z.string()
}))

await userSlot.set(['123'], { id: '123', name: 'Alice' })
const user = await userSlot.get(['123'])
console.log(user)

βœ… Deep merging objects

import { deepMerge } from 'https://deno.land/x/sloth@<version>/src/utils/deep-merge.ts'

const base = { a: 1, b: { c: 2 } }
const extra = { b: { d: 3 } }

const result = deepMerge(base, extra)
console.log(result) // { a: 1, b: { c: 2, d: 3 } }

🧩 Available Modules

Module Description
src/deno/env .env file reading, environment tools
src/deno/kv Typed abstraction over Deno KV
src/utils/deep-merge.ts Deep object merge utility
src/apps/rest (optional) Modular REST stack, domain-driven
(more coming soon) Active micro-module development

πŸ“š Documentation

Full per-module documentation is hosted externally:

πŸ“– Read the docs

Each module includes: βœ… Public API βœ… Practical examples βœ… Real-world use cases


πŸš€ Contributing

We welcome contributions! Please follow these simple rules:

βœ… Use strict TypeScript typing. βœ… Keep modules self-contained (one module = one file or folder). βœ… Follow emoji-annotated commits (we use the πŸ“ emoji-commit convention). βœ… Provide examples + tests for every new feature.

Submit PRs, bug reports, or feature requests anytime!


πŸ—ΊοΈ Roadmap

βœ… Initial release πŸ”œ Publish on Deno Land with semantic versioning πŸ”œ Expand micro-module library πŸ”œ Strengthen test coverage + CI pipelines


πŸ“œ License

MIT


πŸ¦₯ *Slow and steady, we build reliable tools.*