linkify-instagram

0.6.2 • Public • Published

linkify-instagram

npm version Build Status

Click here to try it out in your browser.

Sample Usage

var linkify = require('linkify-instagram');
 
// Linkifies hashtags
console.log(linkify('Hello #World'));
// Hello <a href="https://www.instagram.com/explore/tags/world">#World</a>
 
// The hastag template is customizable
console.log(linkify('Hello #World', '<a href="https://www.instagram.com/explore/tags/{hashtag}" target="_blank">#{hashtag}</a>'));
// Hello <a href="https://www.instagram.com/explore/tags/world" target="_blank">#World</a>
 
// Linkifies usernames
console.log(linkify('Hello @hodor'));
// Hello <a href="https://www.instagram.com/hodor">@hodor</a>
 
// The template is customizable
console.log(linkify('Hello @hodor', undefined, '<a href="https://www.instagram.com/{username}" target="_blank">@{username}</a>'));
// Hello <a href="https://www.instagram.com/hodor" target="_blank">@hodor</a>

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.6.2
    167
    • latest

Version History

Package Sidebar

Install

npm i linkify-instagram

Weekly Downloads

148

Version

0.6.2

License

MIT

Last publish

Collaborators

  • abh1nav