Generate a typed helper for a common runtime concern.
vsceasy helper add --kind secrets
Flags
| Flag | Type | Notes |
|---|
--kind | secrets | config | state | notifications | cache | Required. Which helper. |
--force | boolean | Overwrite an existing helper file. |
Kinds
| Kind | Wraps |
|---|
secrets | context.secrets (typed get/set/delete). Wire initSecrets(context). |
config | workspace.getConfiguration(...) with typed keys. |
state | globalState / workspaceState. Wire initState(context). |
notifications | info / warning / error message helpers. |
cache | in-memory TTL + LRU cache with a wrap(key, fn) helper. |
Examples
vsceasy helper add --kind config
vsceasy helper add --kind secrets
vsceasy helper add --kind cache
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));