Nostalgic Perogi Monogramming

    map-env-node
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.7 • Public • Published

    map-env-node

    The library maps the environment variables to the typescript object.

          NPM         MIT  

    Installation

    Install via NPM:

    npm install map_env_node
     

    Usage

    .env (file)

    API_CREDENTIAL={"projectId":1, "privateKey":"R1FT2S8D6S11H2SAA4HD"}
    

    TypeScript

    import { MapEnv } from "map-env-node";
     
    interface Credential {
      projectId: string;
      privateKey: string;
    }
     
    let credential = MapEnv.get<Credential>("API_CREDENTIAL");
    console.log(credential.projectId);
     
    Result1;

    Functionality

    Function Description Param Return
    keyExists Method to check is exists the environment variable {string} key - variable name boolean
    get< T > Method to get the value from environment variable {string} key - variable name T

    Keywords

    none

    Install

    npm i map-env-node

    DownloadsWeekly Downloads

    9

    Version

    0.1.7

    License

    MIT

    Unpacked Size

    5.12 kB

    Total Files

    5

    Last publish

    Collaborators

    • moirocar
    • fabiano.asj
    • souphsantos
    • lindsaycerqueira