Sun calculation js library which is fully based on formula from http://aa.quae.nl/en/reken/zonpositie.html
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Orion Stark
a7e10d6796
|
7 years ago | |
---|---|---|
.. | ||
.nyc_output | 7 years ago | |
2.patch | 7 years ago | |
LICENSE | 7 years ago | |
README.md | 7 years ago | |
own-or-env.js | 7 years ago | |
package.json | 7 years ago | |
test.js | 7 years ago |
README.md
own-or-env
Use an objects own property, or an environment variable. Optionally treat as a boolean if the env should be set to 1 or 0.
API
ownOrEnv(object, field, env, boolean)
Use the object[field]
if it's an own property, otherwise use the
named environent variable. If boolean
is set to true
, then cast
to a boolean flag.
USAGE
// will set doTheThing to true based on config.doThing, falling back
// to reading process.env.DO_THING, where '0' is treated as false.
var doTheThing = ownOrEnv(config, 'doThing', 'DO_THING', true)
// just treat this one as a string, not a boolean flag
var file = ownOrEnv(config, 'file', 'MY_FILE')