Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

app-conf

Package Overview
Dependencies
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-conf - npm Package Compare versions

Comparing version 0.7.1 to 0.8.0

26

index.js

@@ -51,11 +51,19 @@ "use strict";

function load(appName, opts) {
const ignoreUnknownFormats =
(opts != null && opts.ignoreUnknownFormats) || false;
function load(
appName,
{
appDir = DEFAULT_APP_DIR,
defaults,
entries: whitelist,
ignoreUnknownFormats = false,
} = {}
) {
const useWhitelist = whitelist !== undefined;
if (useWhitelist) {
whitelist = new Set(whitelist);
}
return pMap(entries, entry =>
entry.read({
appDir: (opts && opts.appDir) || DEFAULT_APP_DIR,
appName,
})
useWhitelist && !whitelist.has(entry.name)
? []
: entry.read({ appDir, appName })
)

@@ -82,3 +90,3 @@ .then(files => {

return acc;
}, merge({}, opts && opts.defaults))
}, merge({}, defaults))
);

@@ -85,0 +93,0 @@ }

{
"name": "app-conf",
"version": "0.7.1",
"version": "0.8.0",
"license": "ISC",

@@ -5,0 +5,0 @@ "author": "Julien Fontanet <julien.fontanet@isonoe.net> (http://julien.isonoe.net/)",

@@ -7,13 +7,2 @@ # app-conf

```javascript
var loadConfig = require("app-conf").load;
loadConfig("my-application", {
// this is the directory where the vendor conf is stored
appDir: __dirname,
}).then(function(config) {
console.log(config);
});
```
The following files are looked up and merged (the latest take

@@ -31,2 +20,22 @@ precedence):

```javascript
var loadConfig = require("app-conf").load;
loadConfig("my-application", {
// this is the directory where the vendor conf is stored
appDir: __dirname,
// default config values
defaults: {},
// which types of config should be loaded
entries: ["vendor", "global", "user", "local"],
// whether to ignore unknown file formats instead of throwing
ignoreUnknownFormats: false,
}).then(function(config) {
console.log(config);
});
```
Relative paths, string values starting by `./` or `../`, are automatically

@@ -33,0 +42,0 @@ resolved from the config file directory.

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