@yankeeinlondon/claudine
v0.4.1
Published
A simple library to help with Claude Code
Readme
Claudine
Simple tooling to aid in working with Claude Code CLI.
Usage
Let's imagine that you want to handle the PreToolUse event:
import { createHook } from "@yankeeinlondon/claudine";
await createHook("PreToolUse")
.handler(async (event) => {
// add your handler code, `event` is already strong typed
})
// pick up the text from STDIN, parse it into a strongly typed
// and handle any unexpected errors in a graceful manner
.handle(); By using this builder pattern you are getting:
- strong type control over the inputs and outputs of each event type
- a wrapper around any unexpected errors in your handler code which will help to
Types
You can, if you prefer, just use the types which this library provides.
Installation
NPM Registry
| Manager| Shell Command | | --- | --- | | npm | npm install @yankeeinlondon/claudine | | pnpm | pnpm add @yankeeinlondon/claudine | | yarn | yarn add @yankeeinlondon/claudine | | bun | bun add @yankeeinlondon/claudine |
Deno/JSR
import { createHook } from "jsr:@yankeeinlondon/claudine";Or add to your deno.json:
{
"imports": {
"claudine": "jsr:@yankeeinlondon/claudine"
}
}GitHub Packages
npm install @yankeeinlondon/claudine --registry=https://npm.pkg.github.comOr configure .npmrc:
@yankeeinlondon:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN