@opticlm/nmem
v0.2.0
Published
(Partial) TypeScript SDK of Nowledge Mem, used in Optic.
Readme
@opticlm/nmem
[!WARNING] This library is intended solely for implementing Optic's Extension functionality and has not been designed with reliability in mind for other purposes.
pnpm add zod
pnpm add @opticlm/nmemUsage
import {
NMem,
CannotReachNMemError,
MalformedResponseError,
} from '@opticlm/nmem';
import type { GetSpacesResponse } from '@opticlm/nmem/schema'
const nmem = new NMem();
try {
const spaces: GetSpacesResponse = await nmem.getSpaces();
} catch (e) {
if (e instanceof CannotReachNMemError) {
// ...
} else if (e instanceof MalformedResponseError) {
// ...
}
}