Skip to content

Commit

Permalink
Fixed readme. Cleaned up leftovers.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexindigo committed Nov 28, 2018
1 parent 4e10630 commit c67ddc8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ script:
- node --version
- npm --version
# linting
- yarn ci-lint
- yarn lint
# nodejs testing
- yarn test

Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

A developer-friendly lightweight replacement for the `config` module that works with custom config directories, pluggable parsers and with many other handy features.

[![Linux Build](https://img.shields.io/travis/alexindigo/configly/canary.svg?label=linux:6.x-11.x&style=flat)](https://travis-ci.org/alexindigo/configly)
[![MacOS Build](https://img.shields.io/travis/alexindigo/configly/canary.svg?label=macos:6.x-11.x&style=flat)](https://travis-ci.org/alexindigo/configly)
[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/configly/canary.svg?label=windows:6.x-11.x&style=flat)](https://ci.appveyor.com/project/alexindigo/configly)
[![Linux Build](https://img.shields.io/travis/alexindigo/configly/master.svg?label=linux:6.x-11.x&style=flat)](https://travis-ci.org/alexindigo/configly)
[![MacOS Build](https://img.shields.io/travis/alexindigo/configly/master.svg?label=macos:6.x-11.x&style=flat)](https://travis-ci.org/alexindigo/configly)
[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/configly/master.svg?label=windows:6.x-11.x&style=flat)](https://ci.appveyor.com/project/alexindigo/configly)

[![Coverage Status](https://img.shields.io/coveralls/alexindigo/configly/canary.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/configly?branch=canary)
[![Coverage Status](https://img.shields.io/coveralls/alexindigo/configly/master.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/configly?branch=master)
[![Dependency Status](https://img.shields.io/david/alexindigo/configly.svg?style=flat)](https://david-dm.org/alexindigo/configly)

*Notice of change of ownership: Starting version 3.0.0 this package has changed it's owner and goals. The old version (2.0.3) is still available on npm via `npm install configly@2.0.3` and on [github.com/ksmithut/configly](https://github.com/ksmithut/configly). Thank you.*
Expand Down Expand Up @@ -76,7 +76,7 @@ var configObj = config({
ini : ini.parse,
// have it as a wrapper to prevent extra arguments leaking
cson : function(str) { return cson.parse(str); },
yml : function(str) { return yaml.safeLoad(str); },
yaml : function(str) { return yaml.safeLoad(str); },
// same options as used within `config` module
properties: function(str) { return properties.parse(str, {namespaces: true, variables: true, sections: true}); },
// use json5 instead of `JSON.parse`
Expand All @@ -96,7 +96,7 @@ var configNew = config.new({
ini : ini.parse,
// have it as a wrapper to prevent extra arguments leaking
cson : function(str) { return cson.parse(str); },
yml : function(str) { return yaml.safeLoad(str); },
yaml : function(str) { return yaml.safeLoad(str); },
// same options as used within `config` module
properties: function(str) { return properties.parse(str, {namespaces: true, variables: true, sections: true}); },
// use json5 instead of `JSON.parse`
Expand Down Expand Up @@ -395,16 +395,16 @@ module.exports = configly({
]
},
// also will try to load config files matching current app name
// e.g. `my-app.ini`, 'my-app.js', `my-app.json`, `my-app.yml`,
// `my-app-production.ini`, `my-app-production.js`, `my-app-production.json`, `my-app-production.yml`,
// e.g. `my-app.ini`, 'my-app.js', `my-app.json`, `my-app.yaml`,
// `my-app-production.ini`, `my-app-production.js`, `my-app-production.json`, `my-app-production.yaml`,
// from both local config folder and `/etc/consul`
files: configly.files.concat('my-app'),

// throw in custom parsers as well
parsers: {
ini : ini.parse,
ini : ini.parse,
// have it as a wrapper to prevent extra arguments leaking
yml : function(str) { return yaml.safeLoad(str); }
yaml : function(str) { return yaml.safeLoad(str); }
}
});
```
Expand Down Expand Up @@ -504,7 +504,8 @@ Main differences between `configly` and `config`:
- Configly provides deterministic (and controllable) order of the file extensions it loads from.
- Configly provides post-load hooks for config files, (e.g. `custom-environment-variables` and `custom-include-files` work via this mechanism).
- Configly provides ability to combine environment variables within one entry (e.g. `"endpoint": "${REMOTE_HOST}:${REMOTE_PORT}"`).
- Configly provides ability to "mount" custom config files into specified entries (useful to pull webpack manifest files into app's config).
- Configly supports built-in and custom modifiers for environment variables overrides (e.g. `"loggingEnabled": "boolean LOGGING_ENABLED_BOOLEAN_AS_STRING"`)
- Configly provides ability to "mount" custom config files into specified entries (e.g. useful to pull webpack manifest files into app's config).
- Configly provides access to the underlying functions and defaults, allowing to utilize parts of the functionality for greater flexibility.

### Does Not
Expand All @@ -513,7 +514,7 @@ Main differences between `configly` and `config`:
- Configly doesn't pollute your logs with warnings of non-existent files,
it will either throw (if couldn't read/parse a file) or be silent.
- Configly doesn't provide `get`, `has` methods, it always returns pure js (POJO) object.
- Configly doesn't auto-strip comments from JSON files, use `configly.PARSERS['json'] = json5.parse;`.
- Configly doesn't auto-strip comments from JSON files, instead use `parsers: {json: (str) => json5.parse(str)}`.

## License

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "configly",
"version": "5.0.0-canary.1",
"version": "5.0.0",
"description": "A developer-friendly lightweight replacement for the 'config' module that works with custom config directories and pluggable parsers",
"main": "default.js",
"scripts": {
"lint": "eslint *.js test/*.js",
"ci-lint": "is-node-modern && npm run lint || is-node-not-modern",
"test": "nyc --reporter=lcov --reporter=text --check-coverage --lines 99 --functions 99 --branches 99 tape test/*.js | tap-spec",
"debug": "tape test/*.js | tap-spec"
},
Expand Down Expand Up @@ -67,7 +66,6 @@
"eslint": "^5.9.0",
"hjson": "^3.1.2",
"ini": "^1.3.4",
"is-node-modern": "^1.0.0",
"js-yaml": "^3.6.1",
"json5": "^2.1.0",
"moment": "^2.22.2",
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1119,11 +1119,6 @@ is-fullwidth-code-point@^2.0.0:
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=

is-node-modern@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-node-modern/-/is-node-modern-1.0.0.tgz#cfe2607be7403b05b28a566f66cbf8a583d4fc63"
integrity sha1-z+Jge+dAOwWyilZvZsv4pYPU/GM=

is-promise@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
Expand Down

0 comments on commit c67ddc8

Please sign in to comment.