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

valor-sheet-parser

v0.0.1

Published

### CellEvaluator

Downloads

5

Readme

分析

CellEvaluator

最基础的计算: CellEvaluator, 做两件事:

  1. 递归(或非递归) 地计算 cell 公式, 返回 {id: ParsedResult}, 并记录 know 和 results
  2. 如果 cell.value<>oldCell.value, 则 propagate 到相关单元格(hostCell) 每个单元格执行 1 最终得到的 results: {id:ParsedResult} 即是最终结果, 注意可能影响很多单元格

两种应用场景: 场景 1: 递归重算, 比如 全部重算 & 增删行列 场景 2: 简单计算, 比如 在全部重算完成后, 重新输入一个新公式

对外提供两个方法: // 初始化 const ce = new CellEvaluator(state) // 重算 ( 一般不单独使用 ) ce.evaluate(recursive?:boolean); // 传播 (什么时候用: 如果只是简单输入了 3 这样的 value, 则仅需 propagate) ce.propagate(recursive?:boolean); // 重算并传播 ( 除开上面的用法 ) ce.evaluateAndPropagate(recursive?:boolean); // 获取最终结果, 并重置 results/know ce.getResults(): {id: ParsedResult}

SheetEvaluator

内部包含一个 CellEvaluator 仅需 简单地, 对每个 cell 调用 evaluateAndPropagate, 获取最终 results


特性

  • 基于typescript, 生成es5目标文件
  • 支持jest, 直接在src目录下*.test.ts, 然后 yarn test

何时使用

  • 你希望创建一个可重用的工具方法库(我们通常叫utils)
  • 希望使用typescript
  • 这个库通常可同时供node端与browser端使用
  • 也许你还希望发布到npm

如何使用

git clone https://github.com/g770728y/create-utils-library.git <your-project-name>

vi ./package.json  <== 修改package.json中的project信息
yarn

yarn start

watch模式动态构建

yarn test

watch模式动态测试

yarn build

npm publish