Iโm @MeroFuruya.
Interests:
- Python
- Discord bots (using i.py)
- mongodb (pymongo/motor)
- http/api stuff
- webapps (flask, aiohttp)
- js
- typescript
- express
- typeorm
- Pascal/Delphi
- using it at work as a dev
- mostly vcl stuff (delphi by Embarcadero)
Makes you have a good time with environment variables and dotenv
Home Page: https://www.npmjs.com/package/environmentality
License: MIT License
Iโm @MeroFuruya.
Interests:
const result = envConverter.convert([
{
name: "WONG_BOOLEAN",
type: "boolean",
},
])
expect(result).toEqual({ WONG_BOOLEAN: null })
fails:
- Expected - 3
+ Received + 1
- Object {
- "MISSING_REQUIRED": null,
- }
+ Object {}
see Describe the bug
i expect that to pass
No response
i would like to be able to set variable name matching to case insensitive
Env var name: TEST_STRING
code var name: test_string
this isn't possible atm
:)
i would like default values to be written into process.env
. that would help with other libraries that use environment variables.
if i give NEW_RELIC_ENABLED
a default value and it isnt set in process.env
that it then will be set.
this would allow one to use the library to set variables for other libraries
When trying to set a default value for an array, it gives an type error.
const result = envConverter.convert([
{
name: "DEFAULT_ARRAY",
type: "string",
array: true,
default: ["default1", "default2", "default3"], // <- type error there
},
])
I expect it to enforce an array and be happy with it
fix:
export interface EnvironmentalityPropertyOptions<
T extends EnvironmentalityPropertyTypes,
IsArray extends boolean,
> {
/*
* The name of the environment variable to use. Defaults to the property name.
*/
name?: string
/*
* Whether the environment variable is required. Defaults to true.
*/
required?: boolean
/*
* The default value to use if the environment variable is not set. Defaults to undefined.
*/
default?: IsArray extends true
? EnvironmentalityPropertyTypesConstructor<T>[]
: EnvironmentalityPropertyTypesConstructor<T>
/*
* The type of the environment variable. Defaults to string.
*/
type?: T
array?: IsArray
enumValues?: EnvironmentalityPropertyTypesConstructor<T>[]
}
export type EnvironmentalityPropertyOptionsAny =
// eslint-disable-next-line @typescript-eslint/no-explicit-any
EnvironmentalityPropertyOptions<any, any>
i would like to be able to escape characters from being used for parsing
escape ,
eg in lists by doing \,
same for other symbols
"a,b\,c,d" => ["a", "b,c", "d"]
this would allow parsed characters to be in strings
i was trying to import like that:
import { Env, EnvVar } from "environmentality"
but i had to do that:
import environmentality from "environmentality"
const { Env, EnvVar } = environmentality
do as stated above
i wanna do that maaaaan:
import { Env, EnvVar } from "environmentality"
2.1.0
No response
i would love to be able to set a default value while testing or just have some kind of easyness while testing.
like when node_env
is test
that the "required" becomes obsolete. only if the value is really called.
make testing easier.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.