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

@ktjs/ts-plugin

v0.1.15

Published

TypeScript language service plugin for kt.js k-for scope names in TSX.

Readme

@ktjs/ts-plugin

TypeScript language service plugin for KT.js k-for scope variables in TSX.

What it does

  • Editor-only enhancement (tsserver), no runtime transform.
  • Suppresses TS2304 (Cannot find name ...) for aliases declared by k-for.
  • Infers alias types from iterable/indexed sources (including KTReactive<T[]>; for example k-for="item in users" makes item resolve to users[number]).
  • Provides hover type info and member completions for inferred aliases.
  • Supports hover type info inside k-for expression strings (item in users) for alias/source identifiers.
  • Adds k-for inline semantic highlighting in string expressions (for example alias/keyword/source in k-for="item in list").
  • Highlights directive attribute names (k-for, k-key, k-if, k-else, k-else-if, k-model, k-html) with semantic token colors.
  • Supports Vue-like syntax:
    • k-for="item in list"
    • k-for="(item, i) in list"

Install

pnpm add -D @ktjs/ts-plugin typescript

Then open a .tsx or .ts file in your editor, press Ctrl+Shift+P and select "TypeScript: Select TypeScript Version", then choose "Use workspace version" to make sure your editor uses the version of TypeScript where the plugin is installed.

Where to install it

Install it in the same project/workspace that owns the tsconfig.json where you enable the plugin.

  • Single-package app: install in that app.
  • Monorepo: install in each package that has its own TSX tsconfig and needs this behavior, or install at repo root if your package manager hoists and the editor can resolve it.

If VS Code still does not load the plugin, make sure it uses your workspace TypeScript version.

tsconfig usage

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@ktjs/ts-plugin"
      }
    ]
  }
}

Optional config

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@ktjs/ts-plugin",
        "forAttr": "k-for",
        "keyAttr": "k-key",
        "ifAttr": "k-if",
        "elseAttr": "k-else",
        "elseIfAttr": "k-else-if",
        "modelAttr": "k-model",
        "htmlAttr": "k-html",
        "allowOfKeyword": true
      }
    ]
  }
}

Example

const users = [{ id: 1, name: 'A' }];

const view = (
  <li k-for="(user, i) in users" k-key="user.id">
    {i + 1}. {user.name}
  </li>
);

Without this plugin, user / i are often reported as undefined by the TypeScript language service in TSX.

Official docs

This package itself currently has no standalone official website doc page. The canonical usage guide is this README.

For TypeScript plugin mechanics, see official docs:

  • TSConfig plugins: https://www.typescriptlang.org/tsconfig/#plugins
  • Writing a language service plugin: https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin