Skip to content

derhuerst/commons-photo-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commons-photo-url 📷

Generate the Wikimedia Commons URL of a photo.

npm version build status dependency status dev dependency status ISC-licensed chat on gitter support me on Patreon

Installing

npm install commons-photo-url

Usage

url(photo, [size])
const url = require('commons-photo-url')

console.log(url('Hazelnuts.jpg', url.sizes.medium))
// -> https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Hazelnuts.jpg/800px-Hazelnuts.jpg

Note: url.sizes is compatible with flickr-photo-url.

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.