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

mistc

v2.1.3

Published

compiler for mist templates

Downloads

118

Readme

mistc

Mist 组件编译工具

Install

npm install -g mistc

CLI Usage

mistc [options] file
mistc --help  

Mist 模板编译工具

Usage:
  mistc [options] file

Options:
  -o,--output <file>    输出到指定文件
  -m,--minify           是否进行最小化
  -b,--binary           是否编译为二进制产物
  -u,--check-update     检查更新,输出 JSON 字符串,属性有 hasUpdate, currentVersion, newVersion
  -p,--platform         编译平台
  -d,--debug            是否调试
  -v,--version          输出版本号
  -h,--help             显示帮助

API Usage

import { compile } from 'mistc'

async function test() {
  const templatePath = '/path/to/the/template/file.mist'
  const compiledTemplate = await compile(templatePath, { minify: true, tsxOptions: {
    removeConsoleLog: false,
    symbolNameOptimization: true,
    shortStyleKeyOptimization: false
  }});
  console.log(compiledTemplate)
}

开发指南

.
├── FEATURE.md
├── README.md
├── bin
│   └── mistc
├── dev            // 测试
│   └── test.js
├── package-lock.json
├── package.json
├── src            // 代码
│   ├── binary
│   ├── cli.ts
│   ├── constantFolding.ts
│   ├── convertExpressions.ts
│   ├── exp
│   ├── index.ts
│   ├── inlineComponents.ts
│   └── tsx
├── test            // 单元测试
│   ├── index.js
│   ├── mist
│   └── tsx

1 安装依赖

npm i

2 编写代码

执行测试代码

ts-node ./dev/test.js    

断点调试 打开test.js文件,按F5启动调试

3 跑单元测试

npm run test

4 发布beta版 修改版本号

npm publish --tag=beta

5 发布正式版 修改版本号

npm publish

性能优化

node性能分析

node --prof ./dev/prof.js
node --prof-process isolate-0x7f949e700000-43913-v8.log > processed.txt