# wiki-img-meta

> Get Wikipedia Image Metadata

Latest version **1.1.0** (published 2021-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install wiki-img-meta
pnpm add wiki-img-meta
yarn add wiki-img-meta
bun add wiki-img-meta
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-10-09 |
| First published | 2021-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Abdullah Ammar |
| Maintainers | abdmmar |
| Keywords | wikipedia, image, metadata |

## Links

- npm: https://www.npmjs.com/package/wiki-img-meta
- Repository: https://github.com/abdmmar/wiki-img-meta
- Homepage: https://github.com/abdmmar/wiki-img-meta#readme
- Issues: https://github.com/abdmmar/wiki-img-meta/issues
- npm.io page: https://npm.io/package/wiki-img-meta

## Dependencies (2)

- [cheerio](https://npm.io/package/cheerio.md) 1.0.0-rc.10
- [node-fetch](https://npm.io/package/node-fetch.md) 2.6.1

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

- 1.1.0 (latest) — 2021-10-09
- 1.0.3 — 2021-09-22
- 1.0.2 — 2021-09-22
- 1.0.1 — 2021-09-05
- 1.0.0 — 2021-09-05
- 0.0.1 — 2021-09-04

## README

# wiki-img-meta

[![TypeScript](https://img.shields.io/npm/types/scrub-js.svg)](https://www.typescriptlang.org/)
[![Code style: ESLint](https://img.shields.io/badge/code%20style-ESLint-blueviolet)](https://eslint.org/)
[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

Get Wikipedia image metadata

## Installation

```bash
npm install wiki-img-meta
```

## Usage

```js
import { getImageMetadata } from 'wiki-img-meta'

const url = 'https://id.wikipedia.org/wiki/Berkas:Rinjani_Caldera.jpg'

getImageMetadata(url)
  .then((metadata) => console.log(metadata))
  .catch((err) => console.error(err))
```

## API

### getImageMetadata(url: string): Promise

#### Parameters

- url: string

  URL of the image

  For example:

  - https://commons.wikimedia.org/wiki/File:Val%C3%A8re_et_Haut_de_Cry.jpg
  - https://de.wikipedia.org/wiki/Datei:Cornelia_Froboess.jpg
  - https://pt.wikipedia.org/wiki/Ficheiro:Fran%C3%A7ois-Ren%C3%A9_de_Chateaubriand_by_Anne-Louis_Girodet_de_Roucy_Trioson.jpg

#### Returns

- Promise with Metadata object

  ```
  type Metadata = {
    link: string
    title: string
    width: string
    height: string
    size: string
    type: string
    date: Date | null
    original_source: string | null
    author: string | null
    src: string
    license: License | License[] | null
  }

  type License = {
    type: string | null
    link: string | null
  }
  ```

## Contributing

Feel free to [submit an issues](https://github.com/abdmmar/wiki-img-meta/issues) and create
[pull requests](https://github.com/abdmmar/wiki-img-meta/pulls).

### Learn more

- [Commitizen](https://www.npmjs.com/package/commitizen)

## License

[MIT License](LICENSE)

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