leadconduit-types

A Node.JS module that parses data by type

Usage no npm install needed!

<script type="module">
  import leadconduitTypes from 'https://cdn.skypack.dev/leadconduit-types';
</script>

README

LeadConduit Types

This Node.JS module parses lead data by type.

Build Status

Usage

var types = require('leadconduit-types');
var phone = types.phone.parse('(512) 789-1111');
console.log(phone);

Supported types

In LeadConduit each field has an associated type, which is used to help make sense out of submitted lead data. The following table summarizes all supported types and provides some example values for each.

Data Type Description Examples
string Any string data which can include alphanumeric characters, whitespace, special characters, new lines, etc. John, I would like some information on your product, 0123
number Any string which can be parsed to a number 1000, 9,998.99
date, dob Most strings which are reasonably recognizable as a date, including European formats (month before day) 1995-12-25 (recommended), Dec 25, 1995, 12/25/1995, 25/12/1995
ssn A US Social Security Number. Data submitted in this field transient. It is never stored or logged by LeadConduit. 123-45-6789, 123 45 6789, 123456789
postal code A US, UK, or Canadian postal code 78751, 78751-4424, AA11A 1AA
state A US State abbreviation, or international locality TX, Quebec
range A numeric range, with a high and low boundary. A non-range is also acceptable provided is a number 1 to 10, 1-10, 10+, 10
gender Gender of the consumer Male, Female, Other, M, F, O
phone A US phone number in a common format (optional extension must be preceded by the x character). To specify the type of the phone number append h for home, w for work, or m for mobile to the number. 1-512-789-1111, 512-789-1111 x1234, (512) 789-1111h, 5127891111m, (512) 789-1111w
email An email address foo@bar.com, foo+bar@baz.com
street A street address 4203 Guadalupe St