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

nconf-transforms

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nconf-transforms - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

1

index.js

@@ -30,3 +30,4 @@ var config = require('nconf');

return config;
};

3

package.json
{
"name": "nconf-transforms",
"version": "0.0.3",
"version": "0.0.4",
"description": "web.config like transforms for nconf",
"repository": "https://github.com/e-r-w/nconf-transforms",
"dependencies": {

@@ -6,0 +7,0 @@ "chokidar": "^1.2.0",

# nconf-transforms
Similar to .NET web.config transforms, nconf-transforms allows you to load nconf configuration files based on convention.
Reads the `NODE_ENV` environment variable to select what config file to transform.
Reads the `NODE_ENV` environment variable to select what config file to transform. Currently only supports JSON format.

@@ -8,14 +8,10 @@ ## Usage

```js
require('nconf').argv().env() // don't forget to load your environment/argv variables if you want them!
var transform = require('nconf-transforms');
transform({
dir: __dirname + '/config',
dir: './config',
reload: true // reload nconf when the config file changes
});
//...
var nconf = require('nconf');
nconf.get('someConfig');
```

@@ -27,5 +23,35 @@

/app
app.js
/config
settings.json
settings.production.json
```
```
settings.json
```json
{
"someConfig": "someValue"
}
```
app.js
```js
var nconf = require('nconf');
console.log(nconf.get('someConfig')); // "someValue"
```
## API
`transform(options)`
Loads your base configuration and transforms it using the `NODE_ENV` environment variable to find the transform file.
Options:
- dir: String. The directory to find the configuration files. Defaults to `__dirname`, so set it anyway.
- fileName: String. The name of your configuration files (i.e `settings.json`, `settings.production.json`). Defaults to `settings`
- reload: Boolean. Toggles reloading of configuration when the base config changes.
Returns the `nconf` object so you can chain loading other configuration types/files.
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