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

react-native-link-preview

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-link-preview

Allows to extract information from an URL or parse a text and retrieve information from the first available link.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
269
decreased by-30.31%
Maintainers
1
Weekly downloads
 
Created
Source

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

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
  • cheerio-without-node-native

Check them out, both pretty cool

License

MIT license

Keywords

FAQs

Package last updated on 21 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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