# @giphy/js-util

> Shared giphy js utils

Latest version **5.2.0** (published 2024-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @giphy/js-util
pnpm add @giphy/js-util
yarn add @giphy/js-util
bun add @giphy/js-util
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.2.0 |
| Published | 2024-10-29 |
| First published | 2019-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 61.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | giphy |

## Links

- npm: https://www.npmjs.com/package/@giphy/js-util
- Homepage: https://github.com/Giphy/giphy-js/tree/master/packages/util
- npm.io page: https://npm.io/package/@giphy/js-util

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) ^9.0.0
- [@giphy/js-types](https://npm.io/package/@giphy/js-types.md) *

## Recent versions

- 5.2.0 (latest) — 2024-10-29
- 0.0.0-moat-testing-20240502211419 (moat-testing) — 2024-05-02
- 5.1.0-charlie.0 (charlie) — 2024-04-24
- 5.1.0-beta.1 (beta) — 2024-04-24
- 0.0.0-canary-20230621031504 (canary) — 2023-06-21
- 5.1.0 — 2024-05-03
- 5.1.0-beta.0 — 2024-04-23
- 5.0.0 — 2023-06-26
- 0.0.0-canary-20230620165510 — 2023-06-20
- 4.4.2 — 2023-05-30
- 4.4.1 — 2023-05-16
- 4.4.0 — 2023-05-01
- 4.3.1-alpha.0 — 2023-04-26
- 4.3.0 — 2022-11-29
- 4.2.0 — 2022-11-28
- … 47 more at https://npm.io/package/@giphy/js-util/versions

## README

# @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

---
_Source: https://npm.io/package/@giphy/js-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
