twitter-validate

A Twitter handle validation tool. Checks whether a provided handle meets Twitter's handle criteria. Also provides a method to check whether a provided twitter handle already exists online.

Usage no npm install needed!

<script type="module">
  import twitterValidate from 'https://cdn.skypack.dev/twitter-validate';
</script>

README

Twitter Validate

A Twitter handle validation tool. Checks whether a provided handle meets Twitter's handle criteria. Also provides a method to check whether a provided twitter handle already exists online.

Installation

$ npm install twitter-validate

Usage

Name Type Description
handle string The Twitter handle to validate against Twitter specification
returns boolean Whether handle is valid
validate(handle);
Name Type Description
handle string The Twitter handle to check existence of
handleExists boolean Whether the handle exists on Twitter
exists(handle, function(handleExists){});

Example

var validate = require('twitter-validate').validate;
var exists = require('twitter-validate').exists;

validate("@benderham88") // boolean

exists("@benderham88", function(handleExists){
    handleExists // boolean
});