1.1.0 • Published 3 years ago

wiki-img-meta v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

wiki-img-meta

TypeScript Code style: ESLint Prettier Jest Commitizen friendly

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

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

1.1.0

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago