@otakusan76/nestjs-environment-variables-provider - v1.0.6
    Preparing search index...

    Function StringProperty

    • This decorator can be used to validate and transform a field in a string or an array of strings.

      Parameters

      • OptionalvalidationOptions: ValidationOptions

        Validation options (e.g. each for collections).

      Returns PropertyDecorator

      A property decorator that validates and transforms the field to an string or an array of strings.

      Your can load environment variables in the form of a string.

      import { StringProperty } from '@otakusan76/nestjs-environment-variables-provider/decorators';

      export class EnvironmentVariables {
      @StringProperty()
      public readonly VALUE!: string;
      }

      You also can load environment variables in the form of an array of strings.

      import { StringProperty } from '@otakusan76/nestjs-environment-variables-provider/decorators';

      export class EnvironmentVariables {
      @StringProperty({ each: true })
      public readonly VALUES!: string[];
      }