1.0.1 • Published 5 years ago

opensource-link-previewer v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

Link Previewer

Generate link previews with social metadata, For example, social apps can use the metadata to present shared links as cards with a title, a description of the linked content, and a preview image.

Installation

$ npm i --save opensource-link-previewer

In Node.js

// CommonJS
var LinkPreviewer = require("opensource-link-previewer");
// Load the link previewer
const link = new LinkPreviewer();

link.preview("https://web.whatsapp.com")
.then((response) => {
/*
    Response is look like: 
    [ { title: 'WhatsApp Web' },
    { description: 'Quickly send and receive WhatsApp messages right from your computer.' },
    { 'og:description': 'Quickly send and receive WhatsApp messages right from your computer.' },
    { 'og:title': 'WhatsApp Web' },
    { 'og:image': 'https://www.whatsapp.com/img/fb-post.jpg' } ]
*/
    console.log(`RESPONSE: ${response}`);
})
.catch((reason) => {
    console.log(`Error: ${reason}`);
});

Thankyou 😀🎉