New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

epa

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epa - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

.jshintrc

31

index.js
var path = require("path");
var _ = require("underscore");
var EPA = require("./lib/epa");
var EPA = require("./epa");
var extend = require("./extend");
function buildEnv(){
var configFolder = path.resolve(process.cwd(), "env");
var environmentName = process.env.NODE_ENV || "development";
var configFolder = path.resolve(process.cwd(), "env");
var epa = new EPA({
folder: configFolder,
environment: environmentName,
systemEnv: process.env
});
var epa = new EPA({
folder: configFolder
});
var env = epa.buildEnv();
return env;
}
var env = epa.buildEnv();
module.exports = extend({EPA: EPA}, env);
module.exports = {
EPA: EPA,
getEnvironment: function(){
if (!this._env){
this._env = buildEnv();
}
return this._env;
}
};
{
"name": "epa",
"version": "0.1.1",
"version": "0.2.0",
"description": "simple environment configuration using json files",
"private": false,
"keywords": "environment, config, configuration, production, development, staging, dev, json",
"keywords": [
"environment",
"configuration",
"settings",
"dev",
"development",
"production",
"staging"
],
"main": "./index.js",
"homepage": "https://github.com/derickbailey/epa",
"bugs": {
"url" : "http://github.com/derickbailey/epa/issues"
"bugs": {
"url": "http://github.com/derickbailey/epa/issues"
},

@@ -18,7 +26,12 @@ "license": "MIT",

},
"repository" : {
"type": "git",
"repository": {
"type": "git",
"url": "http://github.com/derickbailey/epa.git"
}
},
"dependencies": {
"grunt-contrib-jshint": "^0.10.0",
"grunt-jasmine-node": "^0.2.1",
"underscore": "^1.7.0"
},
"devDependencies": {}
}

@@ -25,3 +25,3 @@ # EPA

`var epa = require("epa")`
`var epa = require("epa").getEnvironment();`

@@ -47,6 +47,42 @@ **4) Set the NODE_ENV to the right environment when running your app**

```js
var epa = require("epa");
var epa = require("epa").getEnvironment();
var foo = epa.get("foo");
console.log(epa.foo);
```
The same works for environment variables. For example, the current
"NODE\_ENV" environment variable can be retrieved using the same
`get` method:
```js
var epa = require("epa").getEnvironment();
var env = epa.get("NODE_ENV");
console.log(env);
```
## Your Own EPA Instance
The `getEnvironment` method from the EPA object returns a cached, and
default instance of the EPA environment configuration. However, you can
create your own instances whenever you want to, using the `EPA` class
that comes with the `EPA` namespace.
```js
var EPA = require("epa").EPA;
var myEPA = new EPA({
folder: "my-config",
systemEnv: process.env,
environment: "dev"
});
```
The `folder` option tells the EPA system what the root folder of
your environment configurations is. This parameter is combined with
the `environment` option to find the correct `config.json` file.
The `systemEnv` option tells the EPA system what "system" environment
variables to use. You should specify `process.env` unless you have a
good reason not to.
## Legal Mumbo Jumbo

@@ -53,0 +89,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc