6.11.95 • Published 10 months ago

@diotoborg/officia-iste v6.11.95

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

@diotoborg/officia-iste

CI status license npm version

Envey is a library designed to simplify the process of managing and validating environment variables in Node.js applications. It provides a fully type-safe solution for defining and parsing configuration schemas, leveraging the power of Zod's excellent type system.

Installation

pnpm i -E zod @diotoborg/officia-iste

Usage

import { z } from 'zod'
import { createConfig } from '@diotoborg/officia-iste'

const result = createConfig(
    z,
    {
        databaseUrl: {
            env: 'DATABASE_URL',
            format: z.string(),
        },
        port: {
            env: 'PORT',
            format: z.coerce.number().int().positive().max(65535),
        },
    },
    { validate: true },
)

if (!result.success) {
    console.error(result.error.issues)
    // Handle error
}

const { config } = result
//    ^? {
//           readonly databaseUrl: string;
//           readonly port: number;
//       }

Supports schema type inference, similar to Zod's infer:

const schema = {
    logLevel: {
        env: 'LOG_LEVEL',
        format: z.enum([
            'fatal',
            'error',
            'warn',
            'info',
            'debug',
            'trace',
            'silent',
        ]),
    },
} satisfies EnveySchema

type Config = InferEnveyConfig<typeof schema>
//   ^? {
//          readonly logLevel:  "fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent"
//      }

License

MIT

yamles2018weakmapbinpicomatchES2020elbhttpsformatpackage.jsonless cssbundlinges2015back-endbyteOffsetpopmotionsameValueZeroquerystringweaksetlesscssminimalpruneSymbol.toStringTagtypedmobileBigInt64Arrayredactlistenersclient[[Prototype]]browserlistformattingshebangforkArrayBufferarraybuffermergedeeppostcssclassesconsumebootstrap lesskeyworkspace:*testerrdsaccessibilitynamesescapejoipluginbusypathestreecolumnfunction.lengthtyped arraybuffersisinstallfast-clonestoragegatewayvaluesform-validationglobal objectfunctionsortvalidationjsdiffless compilerjsxvisualYAMLinternal slotjsonschemaFloat32ArrayObject.getPrototypeOfSymbolairbnblessjQueryutilhasOwna11y@@toStringTagworkerdropsafestyleboundeventEmitterfast-copyhasOwnPropertybabel-corestyled-componentsprogressfpsECMAScript 2023varsomitutil.inspectspringcss lessinspectstablecolumnstoSortedfullcontainsoffsetextendtoolsstylesheetwhatwglinkcachesyntaxerrorcloudtrailPushnpmequalECMAScript 6Uint16ArraysharedchinesecommanderfastcloneeslintpluginsubprocessagentclassnamestylesECMAScript 2016JSON-SchemabyteLengthcloudsearchsignedbundlerqueryasciiwaapiES2022linuxgdprdeterministicpropertiesES3dotenvanimationECMAScript 3colourglacierbinariesdomprettylocalresolvewidthECMAScript 2015letmockingencryptioncoreirqgroupenvironmentfnmatchscheme-validationes-shim APIcomputed-typespoint-freejson-schemaObject.valuespreserve-symlinkssqsreduxES7electronmatchprotocol-buffersSetserverArray.prototype.flattenschemeperformantthreenodejsmkdirsfsfasttrimStartreact posegestures256textcloudformationtelephoneObject.isautoprefixerastdescriptorutilityextranativeconcatoptionecmascripttoStringTagponyfillloadingelasticachecurlfastcopyloggerawesomesauceloggingserializereact-componentUint8ClampedArrayshellimportexportreadlengthdirdefinePropertyarktypeebsES2021exitvalid3dwhichArray.prototype.includestrimLeftURLSearchParamssidevalidatejestroute53harmonyES2019traversecensoremrclonerobustcss-in-jstypescriptpushsymlinksES6hashmatchAllfastifycompilerexecutehandlersasteriskscodesobjectexpressfullwidthflatMapfile systemassertstoobjectjswindowsfantasy-landRegExp#flagstouchcharacterTypedArraycommandauthenvironmentsRegExp.prototype.flagsIteratorapireplaynodeECMAScript 2018stringifierwritejapaneseflatsomeaccessorpinoESnextflagECMAScriptassigncallboundwritablewaitRFC-6455copyexecfile$.extendcjksetmodulesutilitiesdom-testing-libraryiterateless.jstestingstarterl10nsortedObject.keyssimpledbhandlerspeccss variablecertificatesequalitystatezxformconfignumbergradients css3PromiseWeakSetreuseselfObject.entriesvariablesqsArray.prototype.findLastIndexerror-handlingReflect.getPrototypeOffigletidentifiersmruinUint8ArraymoduleelmbrowsercssinvariantfileObservablescall-bindhas-owntypedarrayWebSocketsECMAScript 2017structuredClonedeepclonetoArraytslibhookformperformanceio-tsgitignoreStyleSheetArraypyyamlargsajaxregextypanionUnderscorelastgroupBygraphqlserviceoutputinstallersuperagentdependency managergetes0System.globalasyncArray.prototype.flatMaptrimtypeerrormatchescloudwatchclassnamesdateredirectwaflogisConcatSpreadablejshintdiffhttpreal-timeStreamsajvrgbtoolkitreadablestreamcallbinduser-streamsbyteECMAScript 2019validatorglobStreamacornreact-hooksstreamdeep-copyincludesglobal this valueES2018takequeueMicrotaskfindLastIndexcompare.gitignoreECMAScript 2022mockeast-asian-widthuploadquoteflagsmapspinnersoptimistrecursiveimporttransportspawnexpressioniterationprivate_.extend__proto__xhrreact-testing-librarykeyscallbackpersistentpatchdeleteprotoObservableespreevestjwtstringrulesUint32Arraytypesafeassertcryptowarningconfigurabledescriptiontypesspeedes2017oncehotrequireString.prototype.matchAll.envhelperi18ndataidlestylingString.prototype.trimvarcss nestingReactiveExtensionsschemaqueueInt16Arrayfixed-widthbinaryshamstringifypropdynamodbexit-codehelpersBigUint64ArraycoerciblesignalssigtermlivewgetRxJSmake dirsymlinkyupcommand-lineawsglobalThisiamttychannelenderrangeerrorECMAScript 5proxytypeofjsoniteratorbcryptnopeartpnpm9viewconcatMapeslintlanguageArray.prototype.containsregular expressiones8transpileremovereact animationrequestreducehardlinksintrinsicec2optimizerconsolerandomECMAScript 7posemanagerprivate datasetImmediateMicrosoftsyntaxcreatesymboltrimRightECMAScript 2021JSONbootstrap cssvalueWeakMaptc39Rxbddless mixinscalllibphonenumberdefineflattendeep-clonextermgetOwnPropertyDescriptoropensslsettingsramdachromejavascriptdependencieswindowlintWebSocketsuperstructmixinsgetPrototypeOfpositiveregexptermfunctionalsesroutetrimEndinputfront-enddragclass-validatorgenericsnested cssinferencetddFunction.prototype.nameformsconstES2017envcircularfunctions6to5hasmapreducecore-jsmetadataemiteffect-tsgetterES8react-hook-formpredictableES2015streamspolyfillpureapollonegative zeroindicatortsphoneeventsslicepipeTypeBoximmutableexecAsyncIteratorchromiumReactiveXglobalsbrowserslistlocationdataviewredux-toolkitworkflowownnpmignorehigher-orderFloat64ArrayTypeScriptimmerfast-deep-clonechildforEachs3multi-packagees2016settertimeshrinkwrapmonorepofetchObjectparserArrayBuffer.prototype.slicebabelregularenumerablemomentparsekinesisrapidiesnsdatastructurecolor-0arraysfpansipropertyhookslrumacosfluxprotobufpackagesArray.prototype.flatfrombannercollection.es6eventDispatcherObject.fromEntriestypeautoscalingstatelessroutingendpointdataViewreducerserializercolorspreprocessorprototypeauthenticationcompile lessdescriptorslockfilearraycollection
6.11.95

10 months ago

6.11.94

10 months ago

6.11.93

10 months ago

6.10.93

10 months ago

6.10.92

10 months ago

6.10.91

10 months ago

6.10.90

10 months ago

6.10.89

10 months ago

6.10.88

10 months ago

6.10.87

10 months ago

6.10.86

10 months ago

6.10.85

10 months ago

6.10.84

10 months ago

6.10.83

10 months ago

6.10.82

10 months ago

6.10.81

10 months ago

6.10.80

10 months ago

6.10.79

11 months ago

6.10.78

11 months ago

6.10.77

11 months ago

6.10.76

11 months ago

6.10.75

11 months ago

6.10.74

11 months ago

6.10.73

11 months ago

6.10.72

11 months ago

6.10.71

11 months ago

6.10.70

11 months ago

6.10.69

11 months ago

6.10.68

11 months ago

6.9.68

11 months ago

6.9.67

11 months ago

5.9.67

11 months ago

5.9.66

11 months ago

5.9.65

11 months ago

5.9.64

11 months ago

4.9.64

11 months ago

4.9.63

11 months ago

4.9.62

11 months ago

4.9.61

11 months ago

4.9.60

11 months ago

4.9.59

11 months ago

4.8.59

11 months ago

4.8.58

11 months ago

4.8.57

11 months ago

4.7.57

11 months ago

4.7.56

11 months ago

4.7.55

11 months ago

4.7.54

12 months ago

4.7.53

12 months ago

4.7.52

12 months ago

4.7.51

12 months ago

4.6.51

12 months ago

4.6.50

12 months ago

4.6.49

12 months ago

4.6.48

12 months ago

3.6.48

12 months ago

3.6.47

12 months ago

3.6.46

12 months ago

3.6.45

12 months ago

3.6.44

12 months ago

3.6.43

12 months ago

3.6.42

12 months ago

3.6.41

12 months ago

2.6.41

12 months ago

2.6.40

12 months ago

2.6.39

12 months ago

2.5.39

12 months ago

2.4.39

1 year ago

2.4.38

1 year ago

2.4.37

1 year ago

2.4.36

1 year ago

2.4.35

1 year ago

2.4.34

1 year ago

2.4.33

1 year ago

2.4.32

1 year ago

2.4.31

1 year ago

2.4.30

1 year ago

2.4.29

1 year ago

2.4.28

1 year ago

2.4.27

1 year ago

2.4.26

1 year ago

2.4.25

1 year ago

2.3.25

1 year ago

2.3.24

1 year ago

1.3.24

1 year ago

1.3.23

1 year ago

1.3.22

1 year ago

1.3.21

1 year ago

1.3.20

1 year ago

1.3.19

1 year ago

1.2.19

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

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