# get-image-pos

> Get image position coordinates

Latest version **0.0.11** (published 2021-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-image-pos
pnpm add get-image-pos
yarn add get-image-pos
bun add get-image-pos
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2021-11-08 |
| First published | 2020-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 298.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Anthony Bobrov |
| Maintainers | anton.bobrov |
| Keywords | image, position, cover, contain, imagesize, bgsize |

## Links

- npm: https://www.npmjs.com/package/get-image-pos
- Repository: https://github.com/antonbobrov/get-image-pos
- Homepage: https://github.com/antonbobrov/get-image-pos#readme
- Issues: https://github.com/antonbobrov/get-image-pos/issues
- npm.io page: https://npm.io/package/get-image-pos

## 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.11 (latest) — 2021-11-08
- 0.0.9 — 2021-04-05
- 0.0.7 — 2020-11-16
- 0.0.6 — 2020-09-19
- 0.0.4 — 2020-09-18
- 0.0.2 — 2020-08-29

## README

# Get image position coordinates

## Documentation: https://antonbobrov.github.io/get-image-pos/



## How to start with NPM
```sh
npm install get-image-pos
```

## How to start with CDN
```html
<script src="https://cdn.jsdelivr.net/npm/get-image-pos/dist/cdn/index.min.js"></script>
```



## Example
```js
import { getPos, applyHTMLPos } from 'get-image-pos';
// for CDN:
// window.getImagePos

const image = document.querySelector("img");

const pos = getPos({
    source: image,
    rule: 'cover',
    container: image.parentElement,
});

applyHTMLPos({
    source: image,
    rule: 'cover',
    container: image.parentElement,
});
```

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