1.1.0 • Published 3 months ago

detect-social-network v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

detect-social-network

npm version license

detect-social-network is a JavaScript library that allows you to identify the social network from a given URL.

Installation

You can install the library using npm:

npm install detect-social-network

Usage

// Using ES6 Import
import detectSocialNetwork from 'detect-social-network';

const url = "https://twitter.com/jack/status/20";
const socialNetwork = detectSocialNetwork(url);

console.log(`The link belongs to: ${socialNetwork}`);
// Using CommonJS
const detectSocialNetwork = require('detect-social-network');

const url = "https://twitter.com/jack/status/20";
const socialNetwork = detectSocialNetwork.default(url);

console.log(`The link belongs to: ${socialNetwork}`);

Supported Social Networks

Currently, detect-social-network can identify the following social networks:

discord
facebook
github
instagram
linkedin
pinterest
reddit
tiktok
tumblr
twitter
youtube
1.1.0

3 months ago

1.0.0

9 months ago