6.11.95 • Published 2 years ago

@diotoborg/officia-iste v6.11.95

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

6.11.94

2 years ago

6.11.93

2 years ago

6.10.93

2 years ago

6.10.92

2 years ago

6.10.91

2 years ago

6.10.90

2 years ago

6.10.89

2 years ago

6.10.88

2 years ago

6.10.87

2 years ago

6.10.86

2 years ago

6.10.85

2 years ago

6.10.84

2 years ago

6.10.83

2 years ago

6.10.82

2 years ago

6.10.81

2 years ago

6.10.80

2 years ago

6.10.79

2 years ago

6.10.78

2 years ago

6.10.77

2 years ago

6.10.76

2 years ago

6.10.75

2 years ago

6.10.74

2 years ago

6.10.73

2 years ago

6.10.72

2 years ago

6.10.71

2 years ago

6.10.70

2 years ago

6.10.69

2 years ago

6.10.68

2 years ago

6.9.68

2 years ago

6.9.67

2 years ago

5.9.67

2 years ago

5.9.66

2 years ago

5.9.65

2 years ago

5.9.64

2 years ago

4.9.64

2 years ago

4.9.63

2 years ago

4.9.62

2 years ago

4.9.61

2 years ago

4.9.60

2 years ago

4.9.59

2 years ago

4.8.59

2 years ago

4.8.58

2 years ago

4.8.57

2 years ago

4.7.57

2 years ago

4.7.56

2 years ago

4.7.55

2 years ago

4.7.54

2 years ago

4.7.53

2 years ago

4.7.52

2 years ago

4.7.51

2 years ago

4.6.51

2 years ago

4.6.50

2 years ago

4.6.49

2 years ago

4.6.48

2 years ago

3.6.48

2 years ago

3.6.47

2 years ago

3.6.46

2 years ago

3.6.45

2 years ago

3.6.44

2 years ago

3.6.43

2 years ago

3.6.42

2 years ago

3.6.41

2 years ago

2.6.41

2 years ago

2.6.40

2 years ago

2.6.39

2 years ago

2.5.39

2 years ago

2.4.39

2 years ago

2.4.38

2 years ago

2.4.37

2 years ago

2.4.36

2 years ago

2.4.35

2 years ago

2.4.34

2 years ago

2.4.33

2 years ago

2.4.32

2 years ago

2.4.31

2 years ago

2.4.30

2 years ago

2.4.29

2 years ago

2.4.28

2 years ago

2.4.27

2 years ago

2.4.26

2 years ago

2.4.25

2 years ago

2.3.25

2 years ago

2.3.24

2 years ago

1.3.24

2 years ago

1.3.23

2 years ago

1.3.22

2 years ago

1.3.21

2 years ago

1.3.20

2 years ago

1.3.19

2 years ago

1.2.19

2 years ago

1.2.18

2 years ago

1.2.17

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago