Skip to content

Environment value to JSON converter #1660

@bellons91

Description

@bellons91

What feature or new tool do you think should be added to DevToys?

A converter that transforms text from this format:

Usage=Direct
LimitRequests=25
ConnectionString=whatever

into this format

{
"Usage":"Direct",
"LimitRequests":"25",
"ConnectionString":"whatever"
}

Why do you think this is needed?

When working on many environments (like k8s), you can retrieve Environment Variables using the command printenv. It returns the variables in the format KEY=VALUE, like

Usage=Direct
LimitRequests=25
ConnectionString=whatever

However, for local development (like when using launchSettings.json for .NET projects) a JSON format is easier to use and reuse.

This functionality is useful for reading and manipulating environment variables copied from a system, like k8s or the local machine.

Solution/Idea

Usage=Direct
LimitRequests=25
ConnectionString=whatever

Must be converted into

{
"Usage":"Direct",
"LimitRequests":"25",
"ConnectionString":"whatever"
}

Comments

Clearly, it's not possible to understand upfront if a number must be treated as a number, so the easiest solution is to treat everything as a string, and the developer will tweak the result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions