npm.io
1.0.2 • Published 2 years ago

@types/parse-env-string

Licence
MIT
Version
1.0.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/parse-env-string

Summary

This package contains type definitions for parse-env-string (https://github.com/watson/parse-env-string#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-env-string.

index.d.ts

/**
 * It takes a string and returns an object.
 * If given null or undefined an empty object is returned.
 * If given anything else, a TypeError is thrown.
 * An `Error` will also be thrown if the provided string doesn't contain valid environment variables.
 * E.g. if given the string `1a=b`, an error will be thrown because environment variables cannot have a digit as the first character.
 */
declare function parseEnvString(str: string | null | undefined): { [key: string]: string };

/**
 * Parse a string containing environment variables to a key/value object.
 */
export = parseEnvString;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Piotr Błażejewicz.