Get Wikipedia image metadata
npm install wiki-img-meta
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))
-
url: string
URL of the image
For example:
-
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 }
Feel free to submit an issues and create pull requests.