From c108373d5da54c5fce6a55b4bb003a9fb7c7379a Mon Sep 17 00:00:00 2001 From: mehmet Date: Wed, 18 Oct 2017 17:07:23 +0200 Subject: [PATCH] readme update --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index faf0ff2..3ed4ff6 100644 --- a/README.md +++ b/README.md @@ -54,13 +54,49 @@ You can pass a string prefix as first paremeter like below: ```javascript const options = readEnv('EXAMPLE'); +// Output: +/** +{ + arrayKey: [ 1, 2, 3, 'string', { prop: 'value' }, 5.2 ], + falseKey: false, + floatKey: 5.2, + intKey: 5, + objectKey: { prop: 'value' }, + stringKey: 'example', + trueKey: true +} +*/ + const optionsLower = readEnv('EXAMPLE', 'lowercase'); +// Output: +/** +{ + array_key: [ 1, 2, 3, 'string', { prop: 'value' }, 5.2 ], + false_key: false, + float_key: 5.2, + int_key: 5, + object_key: { prop: 'value' }, + string_key: 'example', + true_key: true +} +*/ function ucfirst(string) { return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); } const optionsUcfirst = readEnv('EXAMPLE', ucfirst); - +// Output: +/** +{ + Array_key: [ 1, 2, 3, 'string', { prop: 'value' }, 5.2 ], + False_key: false, + Float_key: 5.2, + Int_key: 5, + Object_key: { prop: 'value' }, + String_key: 'example', + True_key: true +} +*/ ``` ### `readEnv(config)`