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

ind-fnd-calc-tools

v1.0.0

Published

- 系统级别配置计算规则表|文件,每个功能选择需要使用的计算规则,应用此工具进行业务计算 - 仅适用于确切的规则,对不同业务场景使用不同计算规则的,需要分开定义 - 可以将计算规则逻辑从代码中提取出去,一方面省略计算的代码,一方面避免手写出错 - 系统级别的计算规则与实际代码隔离,更加清晰,更易于维护和查看 - 经本级node环境测试,1w行数据的处理时间为124ms,性能方面在传统行业业务领域可以接受 - 代码机中生成需要遍历处理结果集的计算代码

Downloads

15

Readme

ind-fnd-calc-tools

计算的小工具,会越来越完善

应用场景

  • 系统级别配置计算规则表|文件,每个功能选择需要使用的计算规则,应用此工具进行业务计算
    • 仅适用于确切的规则,对不同业务场景使用不同计算规则的,需要分开定义
    • 可以将计算规则逻辑从代码中提取出去,一方面省略计算的代码,一方面避免手写出错
    • 系统级别的计算规则与实际代码隔离,更加清晰,更易于维护和查看
    • 经本级node环境测试,1w行数据的处理时间为124ms,性能方面在传统行业业务领域可以接受
  • 代码机中生成需要遍历处理结果集的计算代码

使用方法(未开发java版本,如有需要,请fork之后自行修改)

/** 接收参数 datas, options
 * options {
 *  calcRules: [
 *    {
 *      rltKey: 'UNDONE_RATE', // 处理结果的属性名
 *      rule: '(ALL_COUNT - DONE_COUNT) / ALL_COUNT', // 处理的表达式,目前仅支持由[a-zA-Z_]组成的属性列
 *      precision: 2, // 精度
 *      errRtn: '-' // 除零等异常发生后返回的数据
 *    }
 *  ]
 * }
 * 返回处理后的新数据
 */

// 使用
var CalcTool = require('ind-fnd-calc-tools');

var data = []; // 原始数据数组,可以是从服务器返回的业务数据

// 一些定义的运算的规则
var rules = [
  {
    rltKey: "RATE1", 
    rule: 'DIST_COL_F*100.00/DIST_COL_C-DIST_COL_D*100.00/DIST_COL_C', 
    precision: 2,
    errRtn: '-'
  },
  {
    rltKey: "RATE2", 
    precision: 2,
    errRtn: '-',
    rule: '(DIST_COL_H+DIST_COL_I)*100.00/DIST_COL_C'
  }
]

// 将按照运算规则,处理原始数据
CalcTool.calcDatas(data,{calcRules: rules});