detect-social-network
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i detect-social-network

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

44.9 kB

Total Files

16

Last publish

Collaborators

  • huhulacolle