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:
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.
Learn more
License
MIT License