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

coden-tree-sitter

v0.1.0

Published

CodeN tool plugin: parse source files with Tree-sitter and return a compact JSON AST

Readme

coden-tree-sitter

CodeN 工具插件:读取工作区源码文件,用 Tree-sitter 解析并返回紧凑 JSON 抽象语法树(AST),供 Agent 做代码理解与进一步处理。

安装

coden plugin install npm:coden-tree-sitter
coden plugin list

发布到 npm registry 后可用。项目内安装需先获得工作区信任。

工具:parse_ast

输入:

| 参数 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | filePath | string | 是 | 文件路径,相对工作区或绝对路径 | | language | string | 否 | 覆盖扩展名推断(如 cpptypescript) | | maxSizeBytes | number | 否 | 文件大小上限,默认 2000000,范围 [1024, 20000000] |

返回:content 为紧凑 JSON AST(节点含 typestartRowstartColumnstartIndexendRowendColumnendIndexchildren);metadatalanguagefilePathsizeByteslineCounthasErrorerrorCountparseMs

支持语言

javascripttypescripttsxpythonjavaccppgorustjsonbashhtmlcssc_sharprubyswiftkotlinscalahaskell

typescripttree-sitter 0.25 core 下若 TS 默认导出不可用会自动回退到同包 tsx grammar。)

开发

npm install --legacy-peer-deps
bun run typecheck
bun run test
bun run build

原生依赖 tree-sitter 需要能编译/加载 N-API addon;grammar 包 peer 范围与 [email protected] 有部分冲突,安装时使用 --legacy-peer-deps

已知限制

  • 不读取工作区之外的文件(路径越界返回错误)。
  • 大文件(默认 >2MB)拒绝解析,maxSizeBytes 可在 [1024, 20M] 内调整。
  • 不包含 yamlphpsqlr(对应 grammar 与 tree-sitter 0.25 core 不兼容或不可用)。