glancify
v1.0.1
Published
Get title, description and image from a URL for link preview purposes
Maintainers
Readme
Glancify
🔍 Glancify is a lightweight TypeScript library that generates a link preview from any public URL by extracting the page's title, description, and Open Graph image.
✨ Features
- Automatically extracts:
<title>tag- Meta
descriptiontag - Open Graph meta tags:
og:title,og:description,og:image
- Returns a clean and simple JSON object
- Written entirely in TypeScript
- Designed for server-side usage (Node.js)
📦 Installation
npm install glancify🚀 Usage
import { glancify } from 'glancify';
(async () => {
const preview = await glancify('https://example.com');
console.log(preview);
})();Example output:
{
"title": "Example Page Title",
"description": "This is the meta description of the page.",
"image": "https://example.com/og-image.jpg"
}⚠️ Notes
- Works only with publicly accessible HTTP/HTTPS URLs
- Ideal for backends, social previews, content scrapers
- Assumes HTML is UTF-8 encoded
🛠️ Future Enhancements
- Support for non-UTF-8 charsets
- Add timeout and retry logic
- Use a real HTML parser for improved robustness (e.g.
cheerio)
