Skip to content

Commit 20a257b

Browse files
committed
Update readme
1 parent 7ad61ab commit 20a257b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33

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

6+
## NodeJS support
7+
Library should now work on node environments, thanks to @uriva and @itaibs, I will not rename the library because it may cause confusion for people who try to run in a CORS protected environment (ex. google chrome), since this does not happen for RN that was the original intention of the package.
8+
69
## Getting started
710

811
`$ npm install -S react-native-link-preview`
912

1013
## Usage
1114
Library exposes just one method: getPreview, you have to pass a string (doesn't matter if it is just an URL or a piece of text that contains an URL), the library will take care of parsing it and returning the info of first valid URL info it finds.
1215

13-
1.0.x versions:
14-
The parsing is done automatically via [Autolinker](https://github.com/gregjacobs/Autolinker.js/), if you have problems getting your URL recognized you can dig their documentation for a valid regex.
15-
16-
1.1.x versions:
17-
Parsing is simplified to avoid dependency on Autolinker and having to double check for malformed URLs, basically: string is splitted by space characters and each token is tested against propper regex (https://gist.github.com/dperini/729294), if you have any problems with this please create a ticket, haven't tested all possible cases where this could fail.
16+
URL parsing is done via: https://gist.github.com/dperini/729294
1817

1918
```javascript
2019
import LinkPreview from 'react-native-link-preview';

0 commit comments

Comments
 (0)