autocast
Easily and automatically cast common datatypes in JavaScript
Last updated 13 years ago by bahamas10 .
Repository · Original npm · Tarball · package.json
$ cnpm install autocast 
SYNC missed versions from official npm registry.

autocast

Easily and automatically cast common datatypes in JavaScript

Install

Install locally to use as a madule

npm install autocast

Usage

var autocast = require('autocast');

Example

var autocast = require('autocast'),
    x;

x = autocast('5')
// x => 5
x = autocast('5.8')
// x => 5.8
x = autocast('5.8.8')
// x => '5.8.8'
x = autocast('null')
// x => null
x = autocast('true')
// x => true
x = autocast('false')
// x => false
x = autocast('normal string')
// x => 'normal string'

Tests

npm test

License

MIT Licensed

Current Tags

  • 0.0.4                                ...           latest (13 years ago)

5 Versions

  • 0.0.4                                ...           13 years ago
  • 0.0.3                                ...           14 years ago
  • 0.0.2                                ...           14 years ago
  • 0.0.1                                ...           14 years ago
  • 0.0.0                                ...           14 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |