Skip to content

Extract a twitter screen name from a twitter URL or `@username` string. Return `null` if not valid.

License

Notifications You must be signed in to change notification settings

tableflip/twitter-screen-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twitter-screen-name Build Status Dependency Status

Extract a twitter screen name from a twitter URL or @username string. Return null if not valid.

Example

var twitterScreenName = require('twitter-screen-name')

twitterScreenName('http://twitter.com/_alanshaw') // -> _alanshaw
twitterScreenName('https://www.twitter.com/_alanshaw') // -> _alanshaw
twitterScreenName('http://twitter.com/_alanshaw/status/695527644901801984') // -> _alanshaw
twitterScreenName('@_alanshaw') // -> _alanshaw
twitterScreenName('_alanshaw') // -> _alanshaw
// etc.

twitterScreenName('http://example.org/foo/') // -> null
twitterScreenName('toolongfortwitter') // -> null
// etc.

About

Extract a twitter screen name from a twitter URL or `@username` string. Return `null` if not valid.

Resources

License

Stars

Watchers

Forks

Packages

No packages published