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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@joker.front/ast

v1.3.22

Published

### 概述

Downloads

105

Readme

Joker AST

概述

AST 是 Joker 中 template 的结构化数据,它最终会结合组件实例来渲染出虚拟 Node,并将虚拟 Node 渲染到对应平台中。

它的来源有两种:

  • 通过 单文件组件(SFC) 中的 <template>标签来编写,编写规则请查看模板,并通过CLI转换为 AST.Node[]
  • 通过 Core 中提供的createText,createCommand等方法使用js语法输出 AST.Node[],并设置到组件 template 属性中。template 属性可查看组件属性中的 template 属性介绍。

两种形式都可以输出 AST.Node[],AST.Node 是 AST 的基础类模型,按照功能划分为:Text,Element,Comment,Component四种类型。其中 AST.Node 作为基础模型类,它本身具有以下属性:

| 属性名 | 说明 | 类型 | | --------- | ---- | ---------- | | childrens | 子集 | AST.Node[] | | type | 类型 | NodeType |

可通过判断 type 值来确定当前 AST.Node 的类型:

//该枚举可通过AST.NodeType获得
export enum NodeType {
    TEXT, //文本
    COMMENT, //注释
    ELEMENT, //标签
    COMMAND, //指令
    COMPONENT //动态组件
}

//例如:
item.type === AST.NodeType.COMMENT;

文档

官网

帮助文档