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

octa

v0.4.6

Published

生成指定目录下的Markdown文档元数据。

Readme

Octa

生成指定目录下的Markdown文档元数据。

目录规范

文档目录

文档目录中必须包含两个文件:index.mdmetadata.yml

元数据

文档元数据定义在 metadata.yml 中,包含以下属性:

属性名|可选|类型|说明 ---|---|---|--- title|否|string|文档的标题,在Web端,所有到达该文档的链接将使用该值作为标题。 intro|是|string|文章的简介,在可以显示文章简介的入口处会显示。 author|是|string[]|文档的作者,可以有多个。 tags|是|string[]|文档的标签,可以有多个。

实际生成的元数据中,还包含:

属性名|可选|类型|说明 ---|---|---|--- postID|否|string|内容的唯一ID,对于新的Post,不必手动写入postID,octa会写入到目录的.uuid下 supCategory|否|string|内容的直接上级目录 lastModified|否|String(Date)|最近修改日期 path|否|string|文档目录的相对路径

这两项属性是自动生成的,不必填写。

文档规范

按一般Markdown格式编写即可。

分类目录

根目录下,每一个不包含index.md的目录会被认为是一个分类目录,其下包含的所有子目录,是属于该分类下的子分类或子文档。每一个个分类目录可以设置一个别名,写入到目录下的.alias文件中,例如目录life.alias中写入“生活”,network.alias中写入“网络”,生成的元数据格式应该如下:

[
    {
        "type": "category",
        "cateID": "daf1ca5e-651e-4f23-92c9-7231272264b1",
        "alias": "生活",
        "path": "life",
        "childCates": [
            "459804dd-e3a1-4a82-985a-4b9f9adbeeb2",
            "5583b63a-d705-45bf-b76c-869a92859af5",
            "775f6528-9216-4051-886c-5a882fc2e2cc"
        ],
        "childPosts": [
            "5c45fd16-050d-419a-9b54-ff9c0ba80205"
        ],
        "supCategory": "root"
    },
    {
        "type": "category",
        "cateID": "5583b63a-d705-45bf-b76c-869a92859af5",
        "alias": "网络",
        "path": "life/network",
        "childCates": [],
        "childPosts": [
            "5c45fd16-050d-419a-9b54-ff9c0ba80205"
        ],
        "supCategory": "daf1ca5e-651e-4f23-92c9-7231272264b1"
    }
]

相应的,在Web端处理这些数据数据的时候,alias属性应该展示在页面上,而path属性应该出现在地址栏中。

分类目录不需要做其他设置,按需要嵌套即可。

属性名|类型|说明 ---|---|--- cateID|string|分类目录的唯一ID,查询用,对于新的分类,不需要手动写入cateID,octa会自动生成后写入到.uuidalias|string|分类的显示名称,不影响url path|string|分类的路径,影响url childCates|string[]|子分类的cateID childPosts|string[]|该分类下(包括其子分类)的所有POST的postID,根分类下,此处为空 supCategory|string|上级分类的cateID

数据生成

操作方式

全局安装此包,到文档根目录下,运行命令octa,会在根目录下生成categories.jsonposts.json