is-social
v1.1.3
Published
Validators for social media profiles.
Downloads
4
Readme
is-social
This provides utilities for validating and parsing social media links, with lovely BDD-style assertions.
var is = require('is-social').is;
is.twitter.profile('https://twitter.com/ConnorPeet'); // => true
is.twitter.handle('@ConnorPeet'); // => true
// see more usage below
API
is
runs validations on the input. There are nested functions, which take the input as the first argument and an optional secondoptions
object.- twitter
- profile (twitter profile URL)
- handle (twitter handle). Takes an option
at
, which istrue
to require the "@" symbol,false
to disallow it, and undefined to not care either way. Defaults to undefined.
- facebook
- profile (validates URLs for both profiles and pages)
- name (validates names for both profiles and pages)
- youtube
- url (channel or user URL)
- name (channel or user name)
- player
- url (player.me url)
- name (player.me profile name)
- steam
- name (steam user name)
- id (steam profile 64 bit ID)
- accountName (steam profile URL)
- accountId (steam ID URL)
- instagram
- name (instagram profile username)
- url (instagram url)
- soundcloud
- name (soundcloud profile name)
- url (soundcloud url)
- spreadshirt
- name (spreadshirt profile name)
- url (spreadshirt url)
- patreon
- name (patreon profile name)
- url (patreon url)
- twitch
- name (twitch channel name)
- url (twitch url)
- medium
- profile (medium profile URL)
- handle (medium handle). Takes an option
at
, which istrue
to require the "@" symbol,false
to disallow it, and undefined to not care either way. Defaults to undefined.
- twitter