5.6.86 • Published 10 months ago

@taktikorg/ipsam-voluptatum v5.6.86

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@taktikorg/ipsam-voluptatum

use .env files in your projects

With @taktikorg/ipsam-voluptatum you have the opportunity to use environment variables directly in your project.\ You can parse .env files and add them to the global variables process.env. \ You can also specify default values with @taktikorg/ipsam-voluptatum. These values are used if there is no environment variable.\ This makes it easier to check for errors and use standard configurations.

You also have the option to define nested variables, arrays and objects in the environment file \ You can use inline comments and masked hashtags (\#)

This module is compatible with processenv from TheNativeWeb. I would like to thank the team at TheNativeWeb very much.

Click here to go to the GitHub page of processenv by TheNativeWeb

TheNativeWeb GitHub

Click here to go to the npmjs page of processenv by TheNativeWeb

TheNativeWeb npmjs

Version 2.0.2

checkout the Changelog


Documentation

checkout the documentation

Installation

$ npm install @taktikorg/ipsam-voluptatum

get environment variables

# this .env file is a example
MODE=live
IGNORED=${HOME_PATH}
HOME_PATH=/var/www
LOG_PATH=${HOME_PATH}/log
ACCESS_LOG='${LOG_PATH}/access.log'
ERROR_LOG=${LOG_PATH}/error.log
ERROR_MODE='{ "info": "${LOG_PATH}/info.log", "fatal": "${LOG_PATH}/fatal.log", "exception": "${LOG_PATH}/exception.log" }'
ERROR_MODE_ARRAY='[ "info\\#with masked hash", "fatal", "exception" ]'
INLINE_COMMENT='this is a inline comment #not parsed'
INLINE_COMMENT_WITH_ESCAPE='this is an inline comment \# with masked hash'

basic usage

const { processenv } = require('@taktikorg/ipsam-voluptatum');
const home_path = processenv('HOME_PATH');

full usage

const { processenv } = require('@taktikorg/ipsam-voluptatum');

const getAllEnv = processenv();
/* output: all environment  variables */

const getAllEnvCallback = processenv((env) => {
  return env;
});
/* output: all environment  variables */

const getEnvByKey = processenv('MODE');
/* output: live */

const getEnvByKeyWithDefaultValue = processenv('MODE_TYPE', 'live');
/* output: live - MODE_TYPE does not exist */

const getEnvByKeyWithDefaultByCallback = processenv('MODE_TYPE', (val) => {
  return val ?? 'live';
});
/* output: live - MODE_TYPE does not exist */

const getEnvByKeyWithOperator = processenv('MODE_TYPE') ?? 'live';
/* output: live - MODE_TYPE does not exist */

const getEnvByKeyWithValidateCallback = processenv('MODE', (val) => {
  return val === 'live';
});
/* output: true - MODE is available and is live */

const getEnvByKeyWithAsyncCallback = await processenv('MODE', async (val) => {
  return val === 'live';
});
/* output: true - MODE is available and is live */

const getEnvByKeyWithInlineComment = await processenv('INLINE_COMMENT');
/* output: this is a inline comment */

const getEnvByKeyWithInlineCommentWithEscapedHash = await processenv('INLINE_COMMENT_WITH_ESCAPE_HASH');
/* output: this is a inline comment # with escaped hash */

END

Did you find any suggestions or bugs? Make a pull request or ask your question :-)

espreeboundfigletisConcatSpreadabletypedarrayrapidconfigurablelinuxweakmapvarECMAScript 2020wgetjson-schema-validatorPromiseconcatMapsubprocess@@toStringTagpushbrowserlistchainumberformattingapolloarktypereducerslotcolorjshintgetintrinsicansisymlinkclonepopmotionkeysArray.prototype.findLastIndexregular expressionObject.definePropertyinputsharedintrinsicextraglobalsInt8ArraySystem.globalclassnameString.prototype.matchAlldomenvironmentmapservicejsdiffignoreasciipreprocessorArraycss lessexecutegesturesMap6to5robustpackage.jsonIteratorcollectionArray.prototype.flatzerobundlerconstclientvaluesES3cryptoerrordependenciestslibrecursivedeepphoneinternalcommand-linehandlerECMAScript 2017immerpredictablelockfilecallmomentchromevalidkoreanuninstallinstallerbyteOffsethttpautoprefixerexitUint8ClampedArraybinddayjssignedfullless cssmruStreammatchAlliteratorWebSocketsaccessorstyled-componentsflattencss variablevalidationtyped arraylistenersglacierlessprotojestlesscssnested csscommandes2017URLidentifierserror-handlingredirectECMAScript 7stableestreeArrayBufferencryptionfixed-widtheslintconfigponyfilluser-streamsenumerableSymbol.toStringTaggraphqlgetterstyletestECMAScript 2021ObservableskinesisnamesES8pyyamltraverseenvironmentsCSSramdaspinnersback-endefficientcolorsregexi18npipesqsYAML0astyupsigintpromiseruntimeregular-expressionES2019hasOwnreactcontainsstartervesttranspilercryptelasticacheoptimistfastcopyES5utilitytypeArray.prototype.flattenarraysFloat64ArrayiameslintpicomatchspeedInt32ArraydataViewtypeerrorlintinterruptspathajaxnegative zerofetchlengthendpointcore-jsvisualharmonytransportrequestes6queueObject.fromEntriescolumnpersistentargvmergetermmodulesharedarraybufferhigher-ordersignalsspecentriestostringtagchannelnodejsbinariesRxJSES7loadbalancingESnextroutecssES2016WeakSeteffect-tsmatchwhichroutingparserAsyncIteratortoolkita11ytrimStartmkdirarrayArray.prototype.containsletconsumeStreamssortshrinkwrapES2017definees2016execdiff.envpasswordqueueMicrotaskhasclassnamesregularvarsjQuerysequencedeletegroupByspringworkspace:*RegExp.prototype.flagsstylesheetincludesWeakMapprunebinaryreact-hook-formnpmignoreasserts-0curriedfluxgenericsflatMicrosoftArrayBuffer#slicequotefindLastObject.entriesexit-codeindicatorpropertiesstringifierutil.inspectlogflatMapschemeassertionECMAScript 2019l10nfsprivate dataES2022asyncviewvaluelanguage.gitignorelruauthbeanstalkSetequalidlehashposefromnpmpinoUint16Array3dstateObjectprogressargumentreact-hooksfile systemjapaneseopensslcallbackcallboundpropterminalcollection.es6selfrdsinstallreplaylazyObject.assignfullwidthcheckbuffersvalidateserializersetImmediatebddswfdatesideeventDispatchershebangasterisksnamedeepcopyurlredactstringcloudformationloggingelbescapetextgitignoresymbolsshellfunction.lengthsestoSortedwalksymlinkstesterarttypescriptprotocol-bufferslocaleveryReflect.getPrototypeOfs3syntaxRxtypeofxhrtypedes-shimsiterationECMAScript 3cloudfrontES2020emreslintpluginpreserve-symlinksstoragegatewayassigntouchfpbcrypttypesfast-cloneReactiveXagentgetOwnPropertyDescriptorwaapiwarningcopyeventsJSONES2021outputanimationcss-in-jsTypedArrayreusetddcloudwatchECMAScript 2018typanionhas-ownglobconcatyamldeepcloneauthenticationObject.issignalES2015bundlingglobalThiscall-boundes7argsonceReactiveExtensionsJSON-SchemahotmobileECMAScript 2015setterroute53cloudsearchUint8ArraywidthformdotenvdragacorntacitfunctionschildStyleSheetec2libphonenumberstructuredClonepackagesreact poseclassesqsstreamisInt16Arrayjavascript__proto__json-schemareadablestreamcallbindtoobjectECMAScriptreact-componentnope
5.6.86

10 months ago

5.6.85

10 months ago

5.5.85

10 months ago

5.5.84

10 months ago

5.5.83

10 months ago

5.5.82

10 months ago

5.5.81

10 months ago

5.4.81

11 months ago

5.4.80

11 months ago

5.4.79

11 months ago

5.3.79

11 months ago

5.3.78

11 months ago

5.3.77

11 months ago

5.3.76

11 months ago

5.3.75

11 months ago

5.3.74

11 months ago

5.3.73

11 months ago

5.3.72

11 months ago

5.3.71

11 months ago

5.3.70

11 months ago

5.3.69

11 months ago

5.3.68

11 months ago

5.3.67

11 months ago

5.3.66

11 months ago

5.3.65

11 months ago

5.3.64

11 months ago

5.2.64

11 months ago

5.2.63

11 months ago

5.2.62

11 months ago

5.2.61

11 months ago

5.2.60

11 months ago

5.2.59

11 months ago

5.2.58

11 months ago

5.2.57

11 months ago

4.2.57

11 months ago

4.2.56

11 months ago

4.2.55

11 months ago

4.2.54

12 months ago

4.2.53

12 months ago

4.2.52

12 months ago

4.2.51

12 months ago

4.2.50

12 months ago

4.2.49

12 months ago

4.2.48

12 months ago

4.2.47

12 months ago

4.2.46

12 months ago

4.2.45

12 months ago

4.2.44

12 months ago

4.2.43

12 months ago

4.2.42

12 months ago

4.2.41

12 months ago

4.2.40

12 months ago

4.2.39

12 months ago

4.2.38

12 months ago

4.2.37

12 months ago

4.2.36

12 months ago

4.2.35

12 months ago

4.2.34

1 year ago

4.1.34

1 year ago

4.0.34

1 year ago

4.0.33

1 year ago

4.0.32

1 year ago

4.0.31

1 year ago

4.0.30

1 year ago

3.0.30

1 year ago

3.0.29

1 year ago

3.0.28

1 year ago

3.0.27

1 year ago

3.0.26

1 year ago

3.0.25

1 year ago

3.0.24

1 year ago

3.0.23

1 year ago

3.0.22

1 year ago

3.0.21

1 year ago

2.0.21

1 year ago

2.0.20

1 year ago

2.0.19

1 year ago

2.0.18

1 year ago

2.0.17

1 year ago

2.0.16

1 year ago

2.0.15

1 year ago

2.0.14

1 year ago

2.0.13

1 year ago

2.0.12

1 year ago

2.0.11

1 year ago

2.0.10

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago