Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including textype with all npm packages installed. Try it out:

var textype = require("textype")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

textype v1.0.8

Find the data type by regular expression

TexType

Find the data type by regular expression

Install

npm install textype

How to use

is public ip ?

var textype = require('textype');
var data = '10.10.221.15';
textype.isPublicIP(data);

is internal ip ?

var textype = require('textype');
var data = '10.10.221.15';
textype.isInternalIP(data);

is url ?

var textype = require('textype');
var data = 'https://tanpopo.cc';
textype.isURL(data);
### is e-mail ?
```node
var textype = require('textype');
var data = 'service@tanpopo.cc';
textype.isEmail(data);

is number ?

var textype = require('textype');
var data = '10452.70';
textype.isNumber(data);

is ObjectID ?

var textype = require('textype');
var data = '45cbc4a0e4123f6920000002';
textype.isObjectID(data);

is JSON ?

var textype = require('textype');
var data = '[9, 'b', false]';
textype.isJSON(data);

get multi-type

var textype = require('textype');
var data;
textype.multiType(data);
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free