1.1.13 • Published 3 years ago

@elevatormedia/socialite v1.1.13

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

npm version GitHub Workflow Status GitHub npm downloads npm bundle size GitHub issues

Utility package to extract social media usernames from urls and create urls from usernames.

Installation

NPM:

npm i @elevatormedia/socialite

Yarn:

yarn add @elevatormedia/socialite

Basic Usage

This package offers three functions extractUser, buildUrl, & isValidUrl

extractUser

To extract a username from a social media url:

import { extractUser } from '@elevatormedia/socialite';

const rawURL = 'https://www.twitter.com/myUser';

console.log(extractUser(rawURL));

The above will output myUser;

buildUrl

To retrieve the absolute URL from a given username and type (e.g., facebook, instagram, twitter):

import { buildUrl } from '@elevatormedia/socialite';

const rawUsername = 'myUser';
const type = 'facebook';

console.log(buildUrl(rawUsername, type));

The above call will output https://www.facebook.com/myUser;

isValidDomain

To check if a given url is a valid case of a supported social type:

import { isValidDomain } from '@elevatormedia/socialite';

const url = 'https://www.soundcloud.com/myUser';

console.log(isValidDomain(url));

The above call will output true

Full Documentation & Contributing

⚠️ Please see the repo's wiki for the full documentation on running and contributing to this project ⚠️

1.1.12

3 years ago

1.1.13

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.11

3 years ago

1.1.10-alpha

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.2

3 years ago

1.0.0-beta.6

3 years ago

1.0.0-beta.3

3 years ago

1.0.0-beta.5

3 years ago

1.0.0-alpha.3

3 years ago

1.0.0-alpha.2

3 years ago

1.0.0-beta.1

3 years ago

1.0.0-alpha.1

3 years ago

1.0.0-alpha

3 years ago