File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
packages/metascraper-clearbit-logo Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,13 @@ Default: `png`
3131
3232Image format, either "png" or "jpg".
3333
34+ ##### greyscale
35+
36+ Type: ` boolean ` <br >
37+ Default: ` false `
38+
39+ Desaturates image if set to ` true ` .
40+
3441## License
3542
3643** metascraper-clearbit-logo** © [ microlink.io] ( https://microlink.io ) , Released under the [ MIT] ( https://github.com/microlinkhq/metascraper-clearbit-logo/blob/master/LICENSE.md ) License.<br >
Original file line number Diff line number Diff line change @@ -5,18 +5,21 @@ const got = require('got')
55
66const DEFAULTS = {
77 size : '128' ,
8- format : 'png'
8+ format : 'png' ,
9+ greyscale : false
910}
1011
1112const ENDPOINT = 'https://logo.clearbit.com'
1213
1314module . exports = opts => {
1415 opts = Object . assign ( { } , DEFAULTS , opts )
15- const { size, format } = opts
16+ const { size, format, greyscale } = opts
1617
1718 const clearbitLogo = async ( { url } ) => {
1819 const { hostname } = new URL ( url )
19- const logoUrl = `${ ENDPOINT } /${ hostname } ?size=${ size } &format=${ format } `
20+ const logoUrl = `${ ENDPOINT } /${ hostname } ?size=${ size } &format=${ format } ${
21+ greyscale ? '&greyscale=true' : ''
22+ } `
2023
2124 try {
2225 await got . head ( logoUrl )
You can’t perform that action at this time.
0 commit comments