Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Latest commit

 

History

History
52 lines (37 loc) · 1.18 KB

README.md

File metadata and controls

52 lines (37 loc) · 1.18 KB

Link metadata parser

This parser based on url-metadata module. Also used chardet and iconv-lite for encoding characters, sharp for image conversion, nodemon for local development.

Usage

Either through cloning with git or by using npm (the recommended way):

npm install --save link-metadata-parser

and use in code:

var linkMetadata = require('link-metadata-parser');

/**
 * Also you can pass all options from 
 * https://github.com/LevelNewsOrg/url-metadata/#options
 */
var options = {
    encodeImage: false,
    maxImageWidth: 0
};

linkMetadata(link, options).then(
    (meta) => console.log(meta),
    (err) => console.log(err)
);

Deploy

Repository already contains server example:

npm run server

and it can be running inside Docker:

docker build -t metadata:latest -f ./example/Dockerfile .
docker run -d -p 8080:8080 --name link-metadata-parser metadata:latest

Development

npm run develop