Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-link-preview

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-link-preview - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

27

package.json

@@ -1,5 +0,4 @@

{
"name": "js-link-preview",
"version": "0.0.1",
"version": "1.0.0",
"description": "",

@@ -10,16 +9,12 @@ "main": "index.js",

},
"keywords": [
"js",
"link",
"url",
"preview"
],
"author": "Oscar Franco",
"license": "MIT",
"peerDependencies": {},
"repository" : "https://github.com/ospfranco/js-link-preview",
"dependencies": {
"cheerio-without-node-native": "^0.20.1",
"autolinker": "^1.2.0"
}
"repository": {
"type": "git",
"url": "git+https://github.com/npm/deprecate-holder.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/npm/deprecate-holder/issues"
},
"homepage": "https://github.com/npm/deprecate-holder#readme"
}

@@ -0,46 +1,5 @@

# Deprecated Package
# react-native-link-preview
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.
Allows to extract information from an URL or parse a text and retrieve information from the first available link.
## Getting started
`$ npm install -S react-native-link-preview`
## Usage
You have to pass an object argument with either a valid URL (no validation on library side yet) or a text that can be parsed
```javascript
import LinkPreview from 'react-native-react-native-link-preview';
LinkPreview.getPreview('https://www.youtube.com/watch?v=MejbOFk7H6c')
.then(data => console.warn(data))
.catch(err => console.warn(err))
LinkPreview.getPreview('This is a text supposed to be parsed and the first link displayed https://www.youtube.com/watch?v=MejbOFk7H6c')
.then(data => console.warn(data))
.catch(err => console.warn(err))
```
Returns
```
{
description: "Buy the video on iTunes: https://itunes.apple.com/us/album/needing-getting-bundle-ep/id508124847 See more about the guitars at: http://www.gretschguitars.com...",
images: ["https://i.ytimg.com/vi/MejbOFk7H6c/maxresdefault.jpg"],
mediaType: "video",
title: "OK Go - Needing/Getting - Official Video - YouTube",
url: "https://www.youtube.com/watch?v=MejbOFk7H6c",
videos: undefined
}
```
## Dependencies
This library depends on:
- [Autolinker](https://github.com/gregjacobs/Autolinker.js/)
- [cheerio-without-node-native](https://github.com/oyyd/cheerio-without-node-native)
Check them out, both pretty cool
## License
MIT license
Please contact support@npmjs.com if you have questions about this package.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc