@giphy/js-util

中文文档
5.2.1发布于 2026/10/29MITTypeScriptESM + CJS构建来源已验证近 30 天下载 108.2万

Shared giphy js utils

原始使用文档

@giphy/js-util

More coming soon:

getAltText - get the alt text we display for gifs

bestfit - finds image rendition that best fits a given width and height

getBestRendition - get the best rendition object based on a width and height (uses bestfit)

getBestVideo - get the best video rendition object based on a width and height (uses bestfit)

getBestRenditionUrl - get the best rendition url based on a width and height, also factors in webp availability and if you're using video (uses getBestRendition)

getGifHeight - quick way to get the height for a gif based on a provided width

getGifWidth - quick way to get the width for a gif based on a provided height

getSpecificRendition - get a specific rendition but factor in webp, sticker and video

collections (lodash replacements)

  • mapValues (map for objects)
  • take
  • forEach (forEach for objects)
  • without
  • pick

版本与发布记录

@giphy/js-util 共发布 63 个版本,首次发布于 2019/02/28;过去 12 个月发布了 1 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
5.2.1latest2026/10/2918 天前
5.2.02024/10/302 年前
5.1.02024/05/032 年前
0.0.0-moat-testing-20240502211419moat-testing2024/05/032 年前
5.1.0-charlie.0charlie2024/04/252 年前
5.1.0-beta.1beta2024/04/252 年前

其他发布通道:canary → 0.0.0-canary-20230621031504,beta → 5.1.0-beta.1,charlie → 5.1.0-charlie.0,moat-testing → 0.0.0-moat-testing-20240502211419。

关于 @giphy/js-util 的常见问题

@giphy/js-util 是什么?

Shared giphy js utils

如何安装 @giphy/js-util?

在项目目录运行 npm install @giphy/js-util,或使用 pnpm add / yarn add / bun add。

@giphy/js-util 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@giphy/js-util 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@giphy/js-util 可以商用吗?

@giphy/js-util 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@giphy/js-util 的下载量有多少?

根据 npm 官方下载统计,@giphy/js-util 在 2026/10/17 – 2026/11/15 这 30 天内被下载 1,082,013 次,日均约 36,067 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@giphy/js-util 还在维护吗?

最新版本 5.2.1 发布于 2026/10/29(18 天前);至今共发布 63 个版本,其中过去 12 个月发布了 1 个;首次发布于 2019/02/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。