How to use the envfile.parseFile function in envfile

To help you get started, we’ve selected a few envfile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nfriedly / nfriedly.com / node_modules / docpad / out / lib / docpad.js View on Github external
return safefs.exists(configPath, function(exists) {
        if (!exists) {
          return complete();
        }
        return require('envfile').parseFile(configPath, function(err, data) {
          var key, value;
          if (err) {
            return complete(err);
          }
          for (key in data) {
            if (!__hasProp.call(data, key)) continue;
            value = data[key];
            process.env[key] = value;
          }
          docpad.log('debug', util.format(locale.loadingEnvConfig, configPath));
          return complete();
        });
      });
    });
github lorenwest / node-monitor / node_modules / docpad / out / lib / docpad.js View on Github external
return safefs.exists(configPath, function(exists) {
        if (!exists) {
          return complete();
        }
        return require('envfile').parseFile(configPath, function(err, data) {
          var key, value;
          if (err) {
            return complete(err);
          }
          for (key in data) {
            if (!__hasProp.call(data, key)) continue;
            value = data[key];
            process.env[key] = value;
          }
          docpad.log('debug', util.format(locale.loadingEnvConfig, configPath));
          return complete();
        });
      });
    });

envfile

Parse and stringify the environment configuration files and format, also known as .env files and dotenv files

Artistic-2.0
Latest version published 10 months ago

Package Health Score

66 / 100
Full package analysis