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

@muid-io/smart-doc

v1.0.0

Published

SRK-based document section retrieval tool for extracting text using Smart Resource Keys from smart-toc JSON output

Downloads

99

Readme

@muid-io/smart-doc

SRK-based document section retrieval tool

Overview

smart-doc retrieves text sections from documents using Structural Reference Keys (SRK) generated by smart-toc.

Part of the vibrary document processing pipeline.

Installation

npm install -g @muid-io/smart-doc

Usage

Retrieve by SRK

# Base SRK (section level)
smart-doc document.md --srk "srk://v1/markdown/section-001/section-003"

# Full SRK (with chunking params)
smart-doc document.md --srk "srk://v1/markdown/flexible:1500:300/section-001/0"

Stats Only

smart-doc document.md --srk "srk://v1/markdown/section-001" --stats-only

Batch Retrieval

# Create file with SRKs (one per line)
echo "srk://v1/markdown/section-001" > srks.txt
echo "srk://v1/markdown/section-002" >> srks.txt

# Retrieve all
smart-doc document.md --srk-list srks.txt

With TOC JSON

# Auto-detect TOC file (looks for .json or .toc.json)
smart-doc document.md --srk "srk://v1/markdown/section-001"

# Explicit TOC file
smart-doc document.md --srk "srk://v1/markdown/section-001" --toc document.toc.json

SRK Format

Base SRK (from smart-toc)

srk://v1/{format}/{path}

Example: srk://v1/markdown/section-001/section-003

Full SRK (from vibrary-chunk)

srk://v1/{format}/{strategy}:{target}:{overlap}/{path}/{chunk_index}

Example: srk://v1/markdown/flexible:1500:300/section-001/section-003/0

Output

Default (with text)

{
  "srk": "srk://v1/markdown/section-001/section-002",
  "section_id": "section-002",
  "title": "Quick Stats",
  "text": "## Quick Stats\n...",
  "stats": {
    "char_count": 568,
    "word_count": 63,
    "estimated_tokens": 81
  }
}

Stats Only

{
  "srk": "srk://v1/markdown/section-001",
  "section_id": "section-001",
  "title": "Introduction",
  "stats": {
    "char_count": 1234,
    "word_count": 180,
    "estimated_tokens": 234
  }
}

Options

| Option | Description | |--------|-------------| | --srk <srk> | SRK to retrieve (base or full) | | --srk-list <file> | File with SRKs (one per line) | | --toc <file> | Explicit TOC JSON file | | --stats-only | Return stats without text | | --pretty | Pretty-print JSON output | | --help | Show help | | --version | Show version |

Requirements

  • Node.js >= 14.0.0
  • Python >= 3.6.0

Related

License

MIT