Skip to content

helper add

Generate a typed helper for a common runtime concern.

Terminal window
vsceasy helper add --kind secrets

Flags

FlagTypeNotes
--kindsecrets | config | state | notifications | cacheRequired. Which helper.
--forcebooleanOverwrite an existing helper file.

Kinds

KindWraps
secretscontext.secrets (typed get/set/delete). Wire initSecrets(context).
configworkspace.getConfiguration(...) with typed keys.
stateglobalState / workspaceState. Wire initState(context).
notificationsinfo / warning / error message helpers.
cachein-memory TTL + LRU cache with a wrap(key, fn) helper.

Examples

Terminal window
vsceasy helper add --kind config
vsceasy helper add --kind secrets
vsceasy helper add --kind cache
src/helpers/cache.ts (usage)
import { createCache } from '../helpers/cache';
const cache = createCache<User>({ ttlMs: 60_000, max: 200 });
const u = await cache.wrap('user:' + id, () => orm(User).findById(id));