Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

is-social

1.1.3 • Public • Published

is-social Build Status

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 second options object.
    • twitter
      • profile (twitter profile URL)
      • handle (twitter handle). Takes an option at, which is true 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 is true to require the "@" symbol, false to disallow it, and undefined to not care either way. Defaults to undefined.

Install

npm i is-social

DownloadsWeekly Downloads

17

Version

1.1.3

License

MIT

Unpacked Size

11.6 kB

Total Files

7

Last publish

Collaborators

  • avatar
  • avatar