agentleFS
vorlaxen-labsvorlaxen-labs/Agent-Skills/skills/libraries/huk-js/SKILL.md

huk-js

Skill6 starsChanged 3 months agoMITView on GitHub

Zero-dependency TypeScript utility library (@vorlaxen-labs/huk-js). Nine modules: string, number, date, array, object, is, fn, crypto, storage. Tree-shakeable, Turkish-aware slugify, PII masking. Use when writing utils, validation, slugify, debounce/throttle, type guards, or replacing ad-hoc utils/ folders.

The file

Files
SKILL.md

HuK (Helper Utility Kit)

Package: @vorlaxen-labs/huk-js v1.1.2 · Zero runtime deps · Tree-shakeable

Nine focused utility namespaces replacing scattered utils/ folders with a single, type-safe API.


Critical Rules

  1. Prefer named module imports for backends: import { string, object } from '@vorlaxen-labs/huk-js'.
  2. Use sub-path imports for smallest bundle: import { string } from '@vorlaxen-labs/huk-js/string'.
  3. Use HuK.is.* type guards before treating unknown values as typed — never loose typeof checks.
  4. HuK is not a validation framework — use Zod/Yup for schema validation; HuK for lightweight checks.
  5. Never reimplement utilities HuK already provides — check reference/api-reference.md first.

Import Strategies

// 1. Namespace (scripts, prototypes)
import { HuK } from '@vorlaxen-labs/huk-js';
HuK.string.slugify('Merhaba Dünya!');

// 2. Named modules (recommended for backends)
import { string, object, number } from '@vorlaxen-labs/huk-js';
string.slugify('Hello World');
object.get(user, 'profile.name', 'Anonymous');

// 3. Sub-path (smallest bundle)
import { string } from '@vorlaxen-labs/huk-js/string';

Module Overview

ModuleMethodsPrimary Use
string16Slugify, mask, validate, case transforms, HTML escape
number28Clamp, format, currency, statistics, validation
date14Format, relative time, compare, manipulate
array7groupBy, unique, flatten, shuffle, compact
object4get (path access), pick, clone, merge
is6Runtime type guards with narrowing
fn8debounce, throttle, memoize, retry, sleep, pipe, compose, once
crypto8UUID, SHA-256 hash, base64, validate.*
storage4Browser localStorage wrapper

Quick Examples

import { string, object, number, HuK } from '@vorlaxen-labs/huk-js';

// Turkish-aware slugify
string.slugify('Merhaba Dünya!');  // 'merhaba-dunya'

// PII masking
string.mask('4444555566667777', { visibleEnd: 4 });

// Input validation
string.isEmail(email);
string.isStrongPassword(password);

// Safe nested access
const page = object.get(req.query, 'page', 1);
const search = object.get(req.query, 'search');

// Type-safe query parsing
const searchQuery = object.get(req.query, 'search');
const searchTerm =
  HuK.is.string(searchQuery) && searchQuery.trim().length > 0
    ? searchQuery.trim()
    : undefined;

// Number formatting
number.currency(1234.5, { currency: 'TRY', locale: 'tr-TR' });
number.clamp(value, 0, 100);

// Array grouping
array.groupBy(orders, o => o.status);

// Async helpers
await fn.retry(() => fetchData(), 3, 1000);
const debouncedSearch = fn.debounce(search, 300);

Sub-Path Imports

Import PathModule
@vorlaxen-labs/huk-js/stringString utilities
@vorlaxen-labs/huk-js/numberNumber utilities
@vorlaxen-labs/huk-js/dateDate utilities
@vorlaxen-labs/huk-js/arrayArray utilities
@vorlaxen-labs/huk-js/objectObject utilities
@vorlaxen-labs/huk-js/isType guards
@vorlaxen-labs/huk-js/fnFunction utilities
@vorlaxen-labs/huk-js/cryptoCrypto utilities
@vorlaxen-labs/huk-js/storageBrowser localStorage utilities

HuK + BaR Pattern

import { object, string } from '@vorlaxen-labs/huk-js';

app.get('/api/users', async (req, res) => {
  const search = object.get(req.query, 'search', '');
  const sanitized = string.isEmpty(search) ? undefined : search.trim();
  const users = await userService.search(sanitized);
  return res.builder.as.ok(users).build();
});

When NOT to Use HuK

  • Full schema validation → Zod, Yup, class-validator
  • Timezone-aware dates → date-fns, Luxon, Temporal
  • Entire lodash surface area → HuK is intentionally focused

Reference Documentation

TopicFile
Installation & first importsreference/getting-started.md
Complete method listingreference/api-reference.md
Import style comparisonreference/import-strategies.md
Type guards (HuK.is)reference/is-type-guards.md
String utilitiesreference/string-utils.md
Number utilitiesreference/number-utils.md
Object utilitiesreference/object-utils.md
Array utilitiesreference/array-utils.md
Date utilitiesreference/date-utils.md
Crypto utilitiesreference/crypto-utils.md
Function utilitiesreference/function-utils.md
Storage utilitiesreference/storage-utils.md
Production patternsreference/recipes.md
TypeScript typesreference/typescript.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.