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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tf-utils

v2.2.5

Published

provide for some utilities

Downloads

22

Readme

tf-utils

常用工具集合

命令

  • 跑测试用例
$ npm test
  • 发布
$ npm publish

日志更新

v2.2.5

  • 完善lib/ajax的默认contentType值追加charset=utf-8。

v2.2.4

  • 增加goTop()参数targetElement,使其可以指定目标元素。
  • 增加getScrollTop()参数targetElement,使其可以指定目标元素。
  • 增加getScrollHeight()参数targetElement,使其可以指定目标元素。

v2.2.3

  • 增加rootParent参数到dom/offset()方法,支持指定相对父元素。

v2.2.2

  • 修复Promise.then里返回rejected promise时无法触发catch函数问题。

v2.2.1

  • 增加Promise.reject()方法。

v2.2.0

  • 增加lib/is.date()方法。
  • 增加测试框架及部分测试用例。

v2.1.1

  • 修复Promise的一些BUG。

v2.1.0

  • 增加ES6标准的Promise简单复刻版。

v2.0.1

  • 修复由于使用callee报的错。

v2.0.0

  • 全部改为ES6重写。
  • 增加dom操作getImgFillPos。
  • 增加dom操作getImgResponsivePos。
  • 增加dom操作getScrollHeight。
  • 增加dom操作getScrollTop。
  • 增加dom操作getWindowHeight。
  • 增加dom操作getWindowWidth。
  • 增加dom操作goTop。
  • 增加dom操作insertAtCursor。

v1.4.0

  • 增加dom操作toggleClass。

v1.3.0

  • 增加dom操作hasParent。

v1.2.2

  • 优化操作class相关的dom方法,使用attr来替换className操作。

v1.2.1

  • 优化objectAssign替换逻辑。
  • 优化Promise,支持动态参数。
  • 增加is判断操作库。

v1.2.0

  • 增加Promise实现类。
  • 增加表单form操作模块。
  • 增加ajax模块(支持promise)。

v1.1.0

  • 增加日期格式方法dateFormat。

v1.0.0

  • 创建。