link-preview-js
Advanced tools
Comparing version 2.1.8 to 2.1.9
{ | ||
"name": "link-preview-js", | ||
"version": "2.1.8", | ||
"version": "2.1.9", | ||
"description": "Javascript module to extract and fetch HTTP link information from blocks of text.", | ||
"main": "build/index.js", | ||
"exports": { | ||
"require": "./build/index.js", | ||
"import": "./build/index.js" | ||
".": { | ||
"require": "./build/index.js", | ||
"import": "./build/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
@@ -10,0 +13,0 @@ "types": "build/index.d.ts", |
@@ -1,19 +0,27 @@ | ||
# Link Preview JS | ||
<h1 align="center">Link Preview JS</h1> | ||
Allows you to extract information from a HTTP url/link (or parse a HTML string) and retrieve meta information such as title, description, images, videos, etc. The information is extracted from facebook's OpenGraph protocol. | ||
<div align="center"> | ||
<img src="https://user-images.githubusercontent.com/1634213/127743288-9f8a99f3-75d8-42c5-9a69-b47c661b7e18.jpg" height="500"/> | ||
Created by [Oscar Franco](www.twitter.com/ospfranco). | ||
<pre align="center"> | ||
npm i link-preview-js | ||
</pre> | ||
<a align="center" href="https://github.com/ospfranco?tab=followers"> | ||
<img src="https://img.shields.io/github/followers/ospfranco?label=Follow%20%40ospfranco&style=social" /> | ||
</a> | ||
<br /> | ||
<a align="center" href="https://twitter.com/ospfranco"> | ||
<img src="https://img.shields.io/twitter/follow/ospfranco?label=Follow%20%40ospfranco&style=social" /> | ||
</a> | ||
</div> | ||
Allows you to extract information from a HTTP url/link (or parse a HTML string) and retrieve meta information such as title, description, images, videos, etc. | ||
## GOTCHAs | ||
- **You cannot request a different domain from your web app (Browsers block cross-origin-requests).** If do not know how _same-origin-policy_ works, [here is a good intro](https://dev.to/lydiahallie/cs-visualized-cors-5b8h), therefore this library works on node (back-end environments) and certain mobile run-times (cordova or react-native). | ||
- This library fetches the website and parses its html, **as if the user would visit the page**, this means: YouTube re-directs you to the mobile site and Instagram (and other social sites) might redirect you to a sign up page, you can try to change the user-agent header (try with `google-bot`) and the response you get then might be mangled, but there is nothing wrong with this library, you need to work around these issues yourself. | ||
- You cannot request a different domain from your web app (Browsers block cross-origin-requests). If you don't know how _same-origin-policy_ works, [here is a good intro](https://dev.to/lydiahallie/cs-visualized-cors-5b8h), therefore **this library works on node (back-end environments) and certain mobile run-times (cordova or react-native)**. | ||
- **This library acts as if the user would visit the page, sites might re-direct you to sign-up pages, consent screens, etc.** You can try to change the user-agent header (try with `google-bot` or with `Twitterbot`), but you need to work around these issues yourself. | ||
- When you are testing this library do not use **google.com**, it does not return the necessary headers and you will think the library is broken. | ||
## Install | ||
``` | ||
yarn add link-preview-js | ||
``` | ||
## API | ||
@@ -20,0 +28,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29890
158
0