0.0.2 • Published 11 years ago

tryparse v0.0.2

Weekly downloads
9
License
-
Repository
github
Last release
11 years ago

TryParse

TryParse allows you to test if a value is an integer, a float

Installation

npm install tryparse

Usage

var tryparse = require('tryparse')
var myInt = tryparse.int(4)
> 4
var myFloat = tryparse.float(4.5)
> 4.5
var notInt = tryParse.int('fhjdsk')
> null
var notFloat = tryParse.float('dhgjsjkg')
> null

Run Tests (requires tap: https://npmjs.org/package/tap)

npm test