npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wispbit/sdk-ts

v1.0.28

Published

The core SDK for wispbit's AI code review functionality. This package provides the underlying engine that powers the [@wispbit/cli](https://npmjs.com/package/@wispbit/cli) and allows you to integrate AI code review capabilities directly into your own appl

Readme

@wispbit/sdk-ts

The core SDK for wispbit's AI code review functionality. This package provides the underlying engine that powers the @wispbit/cli and allows you to integrate AI code review capabilities directly into your own applications and environments.

Overview

The SDK provides a complete AI-powered code review system that can:

  • Review code changes against custom rules
  • Analyze files and detect violations
  • Support multiple AI models and providers

Installation

npm install @wispbit/sdk-ts

Quick Start

import { CodeReviewer, newRule } from '@wispbit/sdk-ts'

// Create a code reviewer instance
const reviewer = new CodeReviewer({
  baseURL: 'https://api.openai.com/v1',
  apiKey: process.env.OPENAI_API_KEY!,
  model: 'gpt-4o'
})

// Define a simple rule
const rule = newRule({
  id: 'no-console-log',
  title: 'No console.log statements',
  description: 'Avoid console.log in production code',
  include: ['**/*.ts', '**/*.js'],
  exclude: ['**/*.test.*']
})

// Review code changes
const fileChanges = [
  {
    filename: 'src/app.ts',
    patch: `@@ -1,3 +1,4 @@
 function hello() {
+  console.log('debug message')
   return 'Hello World'
 }`
  }
]

const violations = await reviewer.reviewChanges(fileChanges, [rule])
console.log(violations)

Core Classes

CodeReviewer

The main class that orchestrates AI-powered code reviews.

const reviewer = new CodeReviewer({
  baseURL: 'https://api.anthropic.com',
  apiKey: process.env.ANTHROPIC_API_KEY!,
  model: 'claude-3-5-sonnet-20241022',
  headers: {
    'anthropic-version': '2023-06-01'
  }
})

Rules Management

Creating Rules

import { newRule, newRuleFromBlocks } from '@wispbit/sdk-ts'

// Simple rule
const rule = newRule({
  id: 'typescript-strict',
  title: 'Use TypeScript strict mode',
  description: 'All TypeScript files should use strict mode',
  include: ['**/*.ts'],
  exclude: ['**/*.d.ts']
})

// Rule from markdown blocks
const markdownRule = newRuleFromBlocks([
  '# No TODO comments',
  'TODO comments should not be committed to main branch',
  '```include',
  '**/*.ts',
  '**/*.js',
  '```'
])

Loading Rules

import { getRulesFromDirectory, getRuleFromFile } from '@wispbit/sdk-ts'

// Load all rules from a directory
const rules = await getRulesFromDirectory('./rules')

// Load a single rule file
const rule = await getRuleFromFile('./rules/my-rule.md')

AI Model Support

The SDK supports any OpenAI-compatible API:

// OpenAI
const openaiReviewer = new CodeReviewer({
  baseURL: 'https://api.openai.com/v1',
  apiKey: process.env.OPENAI_API_KEY!,
  model: 'gpt-4o'
})

// Anthropic
const claudeReviewer = new CodeReviewer({
  baseURL: 'https://api.anthropic.com',
  apiKey: process.env.ANTHROPIC_API_KEY!,
  model: 'claude-3-5-sonnet-20241022',
  headers: {
    'anthropic-version': '2023-06-01'
  }
})

TypeScript Support

The SDK is written in TypeScript and provides full type definitions:

import type { 
  FileChange, 
  CodebaseRule, 
  Violation, 
  FileAnalysis 
} from '@wispbit/sdk-ts'

const fileChange: FileChange = {
  filename: 'src/app.ts',
  patch: '...'
}

const rule: CodebaseRule = {
  id: 'my-rule',
  title: 'My Rule',
  description: 'Rule description',
  include: ['**/*.ts'],
  exclude: []
}

Use Cases

  • Custom CI/CD Integration: Build your own code review workflows
  • IDE Extensions: Add AI code review to your favorite editor
  • Git Hooks: Implement pre-commit or pre-push review checks
  • Code Analysis Tools: Build specialized analysis applications
  • Batch Processing: Review large codebases or historical changes
  • Custom Deployment: Run code review in your own infrastructure

Related Packages

Support

License

Open source - see LICENSE file for details.