updated electron due to a security update
This commit is contained in:
78
node_modules/rc/README.md
generated
vendored
78
node_modules/rc/README.md
generated
vendored
@@ -59,7 +59,7 @@ so that sources **earlier** in this list override later ones.
|
||||
|
||||
## Configuration File Formats
|
||||
|
||||
Configuration files (e.g. `.appnamerc`) may be in either [json](http://json.org/example) or [ini](http://en.wikipedia.org/wiki/INI_file) format. The example configurations below are equivalent:
|
||||
Configuration files (e.g. `.appnamerc`) may be in either [json](http://json.org/example) or [ini](http://en.wikipedia.org/wiki/INI_file) format. **No** file extension (`.json` or `.ini`) should be used. The example configurations below are equivalent:
|
||||
|
||||
|
||||
#### Formatted as `ini`
|
||||
@@ -115,6 +115,82 @@ Comments are stripped from JSON config via [strip-json-comments](https://github.
|
||||
> Since ini, and env variables do not have a standard for types, your application needs be prepared for strings.
|
||||
|
||||
|
||||
## Simple example demonstrating precedence
|
||||
Assume you have an application like this (notice the hard-coded defaults passed to rc):
|
||||
```
|
||||
const conf = require('rc')('myapp', {
|
||||
port: 12345,
|
||||
mode: 'test'
|
||||
});
|
||||
|
||||
console.log(JSON.stringify(conf, null, 2));
|
||||
```
|
||||
You also have a file `config.json`, with these contents:
|
||||
```
|
||||
{
|
||||
"port": 9000,
|
||||
"foo": "from config json",
|
||||
"something": "else"
|
||||
}
|
||||
```
|
||||
And a file `.myapprc` in the same folder, with these contents:
|
||||
```
|
||||
{
|
||||
"port": "3001",
|
||||
"foo": "bar"
|
||||
}
|
||||
```
|
||||
Here is the expected output from various commands:
|
||||
|
||||
`node .`
|
||||
```
|
||||
{
|
||||
"port": "3001",
|
||||
"mode": "test",
|
||||
"foo": "bar",
|
||||
"_": [],
|
||||
"configs": [
|
||||
"/Users/stephen/repos/conftest/.myapprc"
|
||||
],
|
||||
"config": "/Users/stephen/repos/conftest/.myapprc"
|
||||
}
|
||||
```
|
||||
*Default `mode` from hard-coded object is retained, but port is overridden by `.myapprc` file (automatically found based on appname match), and `foo` is added.*
|
||||
|
||||
|
||||
`node . --foo baz`
|
||||
```
|
||||
{
|
||||
"port": "3001",
|
||||
"mode": "test",
|
||||
"foo": "baz",
|
||||
"_": [],
|
||||
"configs": [
|
||||
"/Users/stephen/repos/conftest/.myapprc"
|
||||
],
|
||||
"config": "/Users/stephen/repos/conftest/.myapprc"
|
||||
}
|
||||
```
|
||||
*Same result as above but `foo` is overridden because command-line arguments take precedence over `.myapprc` file.*
|
||||
|
||||
`node . --foo barbar --config config.json`
|
||||
```
|
||||
{
|
||||
"port": 9000,
|
||||
"mode": "test",
|
||||
"foo": "barbar",
|
||||
"something": "else",
|
||||
"_": [],
|
||||
"config": "config.json",
|
||||
"configs": [
|
||||
"/Users/stephen/repos/conftest/.myapprc",
|
||||
"config.json"
|
||||
]
|
||||
}
|
||||
```
|
||||
*Now the `port` comes from the `config.json` file specified (overriding the value from `.myapprc`), and `foo` value is overriden by command-line despite also being specified in the `config.json` file.*
|
||||
|
||||
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
|
||||
7
node_modules/rc/index.js
generated
vendored
7
node_modules/rc/index.js
generated
vendored
@@ -1,4 +1,3 @@
|
||||
#! /usr/bin/env node
|
||||
var cc = require('./lib/utils')
|
||||
var join = require('path').join
|
||||
var deepExtend = require('deep-extend')
|
||||
@@ -52,9 +51,3 @@ module.exports = function (name, defaults, argv, parse) {
|
||||
configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined,
|
||||
]))
|
||||
}
|
||||
|
||||
if(!module.parent) {
|
||||
console.log(
|
||||
JSON.stringify(module.exports(process.argv[2]), false, 2)
|
||||
)
|
||||
}
|
||||
|
||||
12
node_modules/rc/package.json
generated
vendored
12
node_modules/rc/package.json
generated
vendored
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_from": "rc@^1.1.2",
|
||||
"_id": "rc@1.2.2",
|
||||
"_id": "rc@1.2.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=",
|
||||
"_integrity": "sha1-oPYGyq4qO4YrvQ74VILAElsxX6M=",
|
||||
"_location": "/rc",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -18,8 +18,8 @@
|
||||
"_requiredBy": [
|
||||
"/electron-download"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz",
|
||||
"_shasum": "d8ce9cb57e8d64d9c7badd9876c7c34cbe3c7077",
|
||||
"_resolved": "https://registry.npmjs.org/rc/-/rc-1.2.4.tgz",
|
||||
"_shasum": "a0f606caae2a3b862bbd0ef85482c0125b315fa3",
|
||||
"_spec": "rc@^1.1.2",
|
||||
"_where": "C:\\Users\\Katy\\documentit\\node_modules\\electron-download",
|
||||
"author": {
|
||||
@@ -28,7 +28,7 @@
|
||||
"url": "dominictarr.com"
|
||||
},
|
||||
"bin": {
|
||||
"rc": "./index.js"
|
||||
"rc": "./cli.js"
|
||||
},
|
||||
"browser": "browser.js",
|
||||
"bugs": {
|
||||
@@ -60,5 +60,5 @@
|
||||
"scripts": {
|
||||
"test": "set -e; node test/test.js; node test/ini.js; node test/nested-env-vars.js"
|
||||
},
|
||||
"version": "1.2.2"
|
||||
"version": "1.2.4"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user