npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dfgyhujk7npm/quam-repellat-ea

v1.0.0

Published

Are you tired of converting environment variables to their respective types, like me? Then this package is for you! This package converts the values of environment variables to their respective types, so you don't have to worry about it anymore.

Downloads

6

Maintainers

tra37500tra37500

Keywords

glob$.extendJSONarraycoloursafeurldebugeslintconfigdirectorytddidstylingquotecircularjsonSymbolRFC-6455east-asian-widthstyleguideopensfaststatuselectronloadingfunctionssideperformancergblimiteddatavieweditorcontainsArrayBuffer.prototype.slicetelephoneslotpopmotionmatches@@toStringTages2015toStringTagTypedArrayObject.valuesdeepspeedreact posees8URLjoiless.jsless compilerfast-copyFloat32ArrayfindLastnegative zerochaimobilecallboundmimetypesjQuerylibphonenumbertrimLeftiejapaneseharmonywordwrapprotobufUint16Arrayl10nfast-deep-copytoSortedlistenersjson-schema-validationtacitparseexpressiondom-testing-libraryeventDispatcheriteratorterminalidleuninstallbufferscollectionvaluetapeArray.prototype.flatexecutableserializeregular expressionsviewupfindcallbindwindowsgroupByschemaECMAScript 2018watcherJSON-SchemadeletequeueES2020react-testing-librarywordbreakreal-timeWebSocketsArray.prototype.findLastclasseses-shim APIauthsymbolssignalsortedcharacterscurriedconcatMapfind-upsymlinksECMAScript 2020jsonschemafunctionalerror-handlingpersistentspinnerstypaniondatapicomatchsignalsformutilshooksremovewebsitecode pointsstringifyvalidstringifierAsyncIteratora11yArray.prototype.includeshttpmkdirextensionframerpackage.jsonincludesmake dirtermcss nestingwatchFileworkspace:*ES3createrapidReflect.getPrototypeOfconfigurabledataViewfull-widthES2021RxJSdefinecensorairbnbconnectrategdprscheme-validationcore-jsoutputmacospropertyfulldiffastequalityspinnerinstallersameValueZeroencryptionvisualuuid256pipetraversevarObservabletoArraycopypreprocessorpnpm9tslibmkdirsinternalrmfile systemwhichposeirqRegExp#flagsdragbyteLengthconcatsetImmediatereactnopeprotogradients css3minimalECMAScript 2023chromiumimportpreserve-symlinksURLSearchParamsObject.getPrototypeOfpathclass-validatorquerystring_.extendprogresspoint-freeredux-toolkitES5numberfptc39findLastIndextypejsdifftypeerrortyped arraystreams2processtranspilercachemiddlewarebrowserlistzodflatMaptrimStartnodeesstablevaluesHyBieslintwebassertionfetches-shimsrm -rfoptimizeriterationtoolkit__proto__lookarraysjson-schemacolumnStyleSheetstatelesscall-bounddayjshardlinksArray.prototype.findLastIndexmomentargumentshrinkwrapdebuggersigtermunicodexhrvalidatorletnamespositivecallinputshellsigintmime-dbECMAScript 7typedarraysgesturescomputed-typessettingsprototypespringflatinstallutilkoreanpluginaccessormovepostcssregexpfigletreducerthroatarktypelessshebangnested cssurlsanimationrfc4122TypeScriptReactiveXcss lessramdabreaktypescriptinferenceTypeBoxwidthmulti-packagecommandcliformatauthenticationpruneparserbyteOffsetajaxwatchinginspectmoduleapiweakmaprangeerrorjsxpyyamllimitECMAScript 5cmdxtermfilesetIteratorObject.keysreadbabel-coreuser-streamsReactiveExtensionstoolsmimesyntaxtimetsyamldroplinuxentriesponyfillduplexES2016tapobjloggingobjecteventstextyupexitMicrosoftdependenciessymbolpolyfilltaskjsonpathes2018descriptorsbannerCSSStyleDeclarationcoercible0UnderscoregetOwnPropertyDescriptorRxstarterdotenvaccessibilityresolvesanitizeshimvariablesnamethrottlechannelttyprettylinewrapdeepcopyutilitytesterstartarraybuffersomeFloat64Arraydefaultjson-schema-validatorschemeES2015classnameES2018cryptqsArray.prototype.containsdeep-clonereuseBigUint64Arrayutilitieslinkdeep-copyclassnamesprivateoffsetfunctionUint32ArraywalkECMAScript 6Int16ArrayInt8Arraypackage managerargvrmdirfast-cloneArrayBuffer#slicesuperstructInt32ArrayArrayBufferthreebufferstreamassignlintnegativewriteerrorSetasciies-abstractruntimeFunction.prototype.namesearchbootstrap lessimmutablefixed-widthzerobluebirdtakegetPrototypeOfregexArray.prototype.flattentypedarraycurlrandomdescriptorhttpscolorbrowsersymlinkspawnreadabledatastructureformses2017efficientqueryloggercommand-linedateYAMLpromiseswatchdeepclonecolorses7busynativeapollomonorepogetintrinsicStreamES7requeststyleserializationmixinsiterateinternal sloteveryframeworkcollection.es6ecmascriptemitrequireworkerUint8ClampedArrayreact animationhigher-ordertouchavaawaitwrapenvironmentes6Array.prototype.filterString.prototype.matchAllcallbackconsoleratelimitnpmeslint-pluginclientpushless mixinsstructuredClonepropertiesObject.entriesbundlingfastifyES2023rm -frwaapivalidateES2019form-validationgraphqlPromise3dES2022clonecall-bindObject.isutil.inspectmetadatajavascripthasOwnenderRegExp.prototype.flagschineselaunchargumentsboundestreeisconstopenjasmineoperating-systemequalajvhasjestlook-updeterministicperformantwarningexpressreact-hooksserializergetsortECMAScript 2015.envdefinePropertyeventEmittermaplastgetterconcurrencykeyObservableswgetsharedarraybuffermochatostringtagrobustargparseopenerstyled-components6to5trimRightgrouptrimEndbrowserslistbatchbcryptbootstrap cssoncecommanderpropprotocol-bufferscomparecryptochecktranspileWebSocketxdg-openvestECMAScript 2021lazyStreamsECMAScript 2017jsdomdependency manageransicss variablepatchstringassertdomextendObject.assigngenericspasswordappsetPrototypeOfes5exit-codedirBigInt64ArraytypedsyntaxerrorECMAScript 2022private datafast-deep-clonesharedemojifantasy-landObject.definePropertyfindupenvnodejslengthisConcatSpreadablecssparenttoobjectcorsES8typesautoprefixeroptimistWeakSetfastcloneeslintpluginECMAScript 2016[[Prototype]]testfullwidthvariables in csswritablehelpersCSShookformconsumevalidationinvariantsliceECMAScript 3ES6interruptsstylesheetawesomesauceexecpromisesequencesuperagentpackagemergefsObject.fromEntriescss-in-jsspeci18nESnextdescriptionargsexefseventslanguageless cssflattentestingredactreducecjkforEachmkdirpstreamsconfighashwhatwgkarmaMaphandlersjwtlesscssescapematchAllflagqueueMicrotaskxdgbytematchtypesafecharacterpurechildlogObjectlruchromeenumerableomitwalkingUint8ArraySymbol.toStringTagArray.prototype.flatMapArrayformattingES2017indicatorintrinsicString.prototype.trimregular expression

Readme

Environment variables with types

Are you tired of converting environment variables to their respective types, like me? Then this package is for you! This package converts the values of environment variables to their respective types, so you don't have to worry about it anymore.

It supports it all (I think, except functions, of course): numbers, booleans, strings, null, undefined, arrays and objects. It also supports nested objects and arrays, in other words, it supports JSON.

Installation

npm install @dfgyhujk7npm/quam-repellat-ea

Usage

The package uses static properties to store the environment variables, so you can access them directly from the Environment class. The properties are named after the environment variables.

This means they only have to be loaded once, and you can access them from anywhere in your code, without having to pass them around or load them over and over again.

If you're using environment variables that are loaded in runtime, you'll need to call the load method before accessing them. If they are already loaded, you don't need to do anything, just access them, lay back and enjoy the magic.

With preloaded environment variables

import { Environment } from '@dfgyhujk7npm/quam-repellat-ea';

console.log(`Number: ${Environment.NUMBER} - Type: ${typeof Environment.NUMBER}`);
console.log(`Boolean: ${Environment.BOOLEAN} - Type: ${typeof Environment.BOOLEAN}`);
console.log(`String: ${Environment.STRING} - Type: ${typeof Environment.STRING}`);
console.log(`Null: ${Environment.NULL} - Type: ${typeof Environment.NULL}`);
console.log(`Undefined: ${Environment.UNDEFINED} - Type: ${typeof Environment.UNDEFINED}`);
console.log(`Object: ${Environment.OBJECT} - Type: ${typeof Environment.OBJECT}`);
console.log(`Array: ${Environment.ARRAY} - Type: ${typeof Environment.ARRAY} - Is array: ${Array.isArray(Environment.ARRAY)}`);

With environment variables loaded in runtime (using dotenv for example)

import dotenv from 'dotenv';
import { Environment } from '@dfgyhujk7npm/quam-repellat-ea';

// If you're not adding the environment variables before script execution,
// you'll need to call the load method. Like this:
dotenv.config();
Environment.load();

console.log(`Number: ${Environment.NUMBER} - Type: ${typeof Environment.NUMBER}`);
console.log(`Boolean: ${Environment.BOOLEAN} - Type: ${typeof Environment.BOOLEAN}`);
console.log(`String: ${Environment.STRING} - Type: ${typeof Environment.STRING}`);
console.log(`Null: ${Environment.NULL} - Type: ${typeof Environment.NULL}`);
console.log(`Undefined: ${Environment.UNDEFINED} - Type: ${typeof Environment.UNDEFINED}`);
console.log(`Object: ${Environment.OBJECT} - Type: ${typeof Environment.OBJECT}`);
console.log(`Array: ${Environment.ARRAY} - Type: ${typeof Environment.ARRAY} - Is array: ${Array.isArray(Environment.ARRAY)}`);

Environment variables used in the examples

This is the environment file that I used in the examples above:

NUMBER=8
BOOLEAN=true
STRING=hello world
NULL=null
NULL_2=
UNDEFINED=undefined
ARRAY=[1,2,3]
OBJECT={"a":1,"b":2,"c":3}

API

Environment.load(config?: EnvironmentConfig)

Loads the environment variables. If you're using environment variables that are loaded in runtime, you'll need to call this method before accessing them.

EnvironmentConfig

binaryToBooleans?: boolean

If set to true, the package will convert the string 1 to true and the string 0 to false.
Default: true

emptyStringsToNull?: boolean

If set to true, the package will convert empty strings to null.
Default: true