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

layerconvert

v1.1.2

Published

flat object via rules

Readme

a simple convert tools

  • 个人学习使用。目前仅用于简单的数据转换,不负责数据同步
  • 编译原理没学好
  • 规则定义
  • 下行
  • 上行

规则定义

  • 目前仅支持很简单的单行表达式
  • 等我研究一下编译原理,和部分编译器后,可能会增强部分功能。
  • 左侧为本地规则,右侧为远端规则
  • 支持简单计算,
  • 不支持rawText
  • 都是通过function body来完成的。

下行

  • 远端数据根据规则映射成本地属性的值

上行

  • 本地数据按照规则映射成远端属性的值

开发中的功能

  • 单行表达式支持简单字面量。不支持字面对象,数组。
  • 支持多行表达式与赋值语句,每行以‘;’结束
  • 支持返回最后一行内容
  • 支持下行扩展
  • 支持上行扩展
  • 通过提供thisArgs,可以自定义复杂的功能。

修改

经过思考这里的内容应当尽量简单,这个只是js中数据映射的辅助工具,而不是强大的语言支持。 复杂的语言支持,会导致解析过程消耗的资源比运行还多,同时导致映射过程难以追踪与维护。 个人觉得支持多行赋值语句、支持js字面量就可以了。 综上内部函数的实现会被延期。 其实可以用的已有的解析工具处理,参考了源码之后,功能都非常棒,但不是最初的本义。不过这个工具应该可以通过扩展来引入这些解析工具,使得我们能够改善、增强。

作弊

还可以完全不解析,都有js来完成,但是functio

使用 typescript 描述定义文件

  • yarn add -D typescript
  • typescript 3.7 之后的版本提供从js文件生成.d.ts的功能
  • npx typescript src/index.js --declaration --allowJs --emitDeclarationOnly --outDir dist