wiki-img-meta
v1.1.0
Published
Get Wikipedia Image Metadata
Downloads
2
Readme
wiki-img-meta
Get Wikipedia image metadata
Installation
npm install wiki-img-meta
Usage
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 and create pull requests.