Version: v0.7.0 - Beta.  We welcome contributors & feedback.

Config.getNumber

Config.getNumber($key, $default = 0) -> number

Description

Like get(), but the value is parsed as a number.

Example app.jcon:

{
    tht: {
        ...
    }

    app: {
        numArticlesOnHomePage: 15
        showBioInFooter: true
        contact: {
            email: hello@example.com
            twitter: @myusername
        }
    }
}

In THT:

Config.getNumber('numArticlesOnHomePage')
//= 15

Config.getNumber('missingKey')
//= 0

See Also