# keep-image

> To keep the image's scale in element.

Latest version **0.0.1** (published 2017-08-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install keep-image
pnpm add keep-image
yarn add keep-image
bun add keep-image
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-08-14 |
| First published | 2017-08-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Samuel Zhang |
| Maintainers | shockw4ver |
| Keywords | util, image, scale, keep, scale |

## Links

- npm: https://www.npmjs.com/package/keep-image
- npm.io page: https://npm.io/package/keep-image

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-08-14

## README

# keep-image

## 描述
---
用于保持图片在页面中的纵横比

## 用法
---
根据相应的模块规范导入（以下以 CommonJS 为例）：
```javascript
var keepImage = require('keep-image'');

keepImage(el, el.parentNode);
```
*其中``el``是图片所在元素，即包含src属性的img元素。*

经过该工具函数的处理，图片在元素内能总是按照自己的纵横比填满元素

---

## Description
---
To keep an image's scale in a html element

## Usage
Import it by correct module specification(take CommonJS for example here):
```javascript
var keepImage = require('keep-image'');

keepImage(el, el.parentNode);
```
*``el`` is the ``img`` element with attribute ``src`` of the image to be kept scale.*

By using this function, the image will fill the element while keeping its scale.

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