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

@cle-engine/sdk

v1.0.0

Published

Official JavaScript/TypeScript SDK for the CLE Engine API - Continuing Legal Education compliance calculations

Readme

CLE Engine JavaScript/TypeScript SDK

Official JavaScript/TypeScript SDK for the CLE Engine API - Continuing Legal Education compliance calculations.

Installation

npm install @cle-engine/sdk

Or with yarn:

yarn add @cle-engine/sdk

Or with pnpm:

pnpm add @cle-engine/sdk

Quick Start

import { CLEEngineClient } from '@cle-engine/sdk';

// Initialize the client with your API key
const client = new CLEEngineClient({
  apiKey: 'your-api-key'
});

// Compute CLE due date for Arizona
const result = await client.computeDueDate('AZ');
console.log(`Due date: ${result.dueDate}`);
console.log(`Credits required: ${result.creditsRequired}`);

Usage Examples

Compute Due Date

import { CLEEngineClient } from '@cle-engine/sdk';

const client = new CLEEngineClient({ apiKey: 'your-api-key' });

// Simple computation for Arizona
const azResult = await client.computeDueDate('AZ');

// California requires last name for surname-based compliance groups
const caResult = await client.computeDueDate('CA', {
  lastName: 'Smith'
});
console.log(`California due date: ${caResult.dueDate}`);
console.log(`Compliance group: ${caResult.reportingGroup}`);

// Florida requires admission date
const flResult = await client.computeDueDate('FL', {
  admissionDate: '2020-06-15'
});

// Handle missing required fields
if (caResult.missingFields.length > 0) {
  console.log(`Missing fields: ${caResult.missingFields.join(', ')}`);
}

Get Supported Jurisdictions

const { jurisdictions, count } = await client.getJurisdictions();

console.log(`Total jurisdictions: ${count}`);

// Filter jurisdictions that require CLE
const cleRequired = jurisdictions.filter(j => j.cleRequired);
console.log(`Jurisdictions requiring CLE: ${cleRequired.length}`);

// Find a specific jurisdiction
const california = jurisdictions.find(j => j.code === 'CA');
if (california) {
  console.log(`California requires: ${california.requiredFields.join(', ')}`);
}

Health Check

const health = await client.healthCheck();

if (health.status === 'healthy') {
  console.log(`API is operational (v${health.version})`);
} else {
  console.warn(`API status: ${health.status}`);
}

Get Population Statistics

// National statistics
const nationalStats = await client.getStats();
console.log(`Total attorneys: ${nationalStats.totals.totalAttorneys}`);

// California-specific statistics
const caStats = await client.getStats({ jurisdiction: 'CA' });

// Custom window for upcoming renewals
const stats = await client.getStats({
  windowDays: 90,
  asOf: '2025-01-01'
});

API Reference

CLEEngineClient

Constructor

new CLEEngineClient(config: CLEEngineConfig)

Config Options:

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | apiKey | string | Yes | - | Your CLE Engine API key | | baseUrl | string | No | https://api.cle-engine.com | API base URL | | timeout | number | No | 30000 | Request timeout in milliseconds | | headers | Record<string, string> | No | {} | Custom headers for all requests |

Methods

computeDueDate(jurisdiction, options?)

Compute the CLE due date for a given jurisdiction.

computeDueDate(
  jurisdiction: string,
  options?: ComputeDueDateOptions
): Promise<ComputeDueDateResponse>

Options:

| Option | Type | Description | |--------|------|-------------| | profession | string | Licensed profession (default: "lawyer") | | lastName | string | Last name for surname-based groups | | birthDate | string | Date of birth (YYYY-MM-DD) | | admissionDate | string | Bar admission date (YYYY-MM-DD) | | reportingCategory | string | State-specific reporting category | | reportingPeriodEnd | string | Reporting period end date (YYYY-MM-DD) | | renewalYear | number | Renewal year |

Response:

| Field | Type | Description | |-------|------|-------------| | dueDate | string? | CLE compliance due date (YYYY-MM-DD) | | cycleStart | string? | Compliance cycle start date | | cycleEnd | string? | Compliance cycle end date | | creditsRequired | number? | Credits required in this cycle | | reportingGroup | string? | Reporting group identifier | | cleRequired | boolean? | Whether CLE is required | | requiredFields | string[] | Fields required for computation | | missingFields | string[] | Required fields that were not provided | | citations | Citation[] | Source citations | | notes | string? | Additional notes |

getJurisdictions()

Get all supported jurisdictions.

getJurisdictions(): Promise<JurisdictionsResponse>
healthCheck()

Check the API health status.

healthCheck(): Promise<HealthCheckResponse>
getStats(options?)

Get population statistics.

getStats(options?: StatsOptions): Promise<StatsResponse>

Error Handling

The SDK throws CLEEngineError for API errors:

import { CLEEngineClient, CLEEngineError } from '@cle-engine/sdk';

const client = new CLEEngineClient({ apiKey: 'your-api-key' });

try {
  const result = await client.computeDueDate('XX'); // Invalid jurisdiction
} catch (error) {
  if (error instanceof CLEEngineError) {
    console.error(`API Error: ${error.message}`);
    console.error(`Status: ${error.status}`);
    console.error(`Code: ${error.code}`);
  }
}

Browser Usage

The SDK works in both Node.js and browser environments:

<script type="module">
  import { CLEEngineClient } from 'https://cdn.jsdelivr.net/npm/@cle-engine/sdk/dist/index.mjs';

  const client = new CLEEngineClient({ apiKey: 'your-api-key' });
  const result = await client.computeDueDate('CA', { lastName: 'Smith' });
  console.log(result);
</script>

TypeScript Support

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

import {
  CLEEngineClient,
  CLEEngineConfig,
  ComputeDueDateOptions,
  ComputeDueDateResponse,
  Jurisdiction,
  CLEEngineError
} from '@cle-engine/sdk';

// All types are available for use
const config: CLEEngineConfig = {
  apiKey: process.env.CLE_ENGINE_API_KEY!,
  timeout: 10000
};

const client = new CLEEngineClient(config);

License

MIT