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

@k-apps-io/llm-dsl-anthropic

v0.0.2

Published

A @k-apps-io/llm-dsl Implementation for Antropic (Claude)

Readme

@k-apps-io/llm-dsl-anthropic

This is an implementation of @k-apps-io/llm-dsl for Anthropic

Installation

npm install @k-apps-io/llm-dsl-anthropic

Usage

Hello World

import { CODE_BLOCK_RULE, json, Locals, stdout } from '@k-apps-io/llm-dsl';
import Anthropic from '@k-apps-io/llm-dsl-anthropic';

type ChatLocals = Locals & {
  languages: string[];
};

const session = new Anthropic<ChatLocals, undefined>({
  options: {
    apiKey: process.env.ANTHROPIC_API_KEY!,
    model: 'claude-sonnet-4-20250514',
  },
  settings: {
    windowSize: 150000, // max is 200k
  },
});

chat
  .rule(CODE_BLOCK_RULE)
  .prompt({
    message: 'Hello!',
  })
  .response(({ response }) => {
    return new Promise<void>((resolve, reject) => {
      // here you can access the response of the LLM and do what you like

      // to move onto the next stage, resolve the promise
      resolve();
    });
  })
  // send a follow up prompt to the LLM
  .prompt({
    message:
      'send me 3 progamming languages as a JSON array e.g ```json ["lang1", "lang2", "langN"]```',
    response_format: { type: 'json_object' },
  })
  .expect(
    json(),
    ({ response, chat: $chat }) =>
      new Promise<void>((resolve, reject) => {
        // here we can access the json response and assign it to locals for later use
        $chat.locals.languages = $chat.locals.$blocks as string[];
        resolve();
      })
  )
  .promptForEach(({ locals }) => {
    // now we can use the languages provided by the response
    return locals.languages.map((language) => {
      const message = `write me a hello world progamming in ${language}`;
      return { message: message };
    });
  })
  // stream the responses to a handler, stdout() is provided OOTB as are others
  .stream(stdout())
  .then(() => {
    console.log('done');
  })
  .catch((error) => {
    console.error(error);
  });

Support

If you find this package useful and would like to support its maintenance and development, there are several ways you can contribute:

  • Bug Reports and Feature Requests: If you encounter any bugs or have ideas for new features, please open an issue on GitHub. Your feedback helps improve the package for everyone.
  • Spread the Word: Help others discover this package by sharing it on social media, forums, or your own networks. Every mention counts and contributes to the growth of the community around the package.

Your support is greatly appreciated! Thank you for using and contributing to this package.