Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additions to README #20

Merged
merged 11 commits into from
Jan 16, 2014
Merged

Additions to README #20

merged 11 commits into from
Jan 16, 2014

Conversation

mikermcneil
Copy link
Contributor

Just some minor stuff I ran into:

  • Added explanation of how to use the third argument to rc (presumably for unit testing)
  • Added a clarification that the result of calling require('rc', 'foo', {}) will be your config. Sort of obvious, but I still had to check the first time I used the library. Maybe I'm just dense :)

@mikermcneil
Copy link
Contributor Author

The last few commits are just me adding some more examples and explaining the details about how parts of it work (especially the merging together of objects, which is intuitive, but helpful to know right out the gate so you don't have to check to see if it works). Also mentioned the support for ini sections for nested objects.

@mikermcneil
Copy link
Contributor Author

And the last bit is just a note to make sure folks (err like me) understand you can't do things like:

[foo]
  works=true
  [bar]
    works=false

(results in foo: { works: false, '[bar]': true, stuff: 'ok' })

Which is fine, because the ini format doesn't allow for nested sections, but still worth pointing out I think.

@mikermcneil
Copy link
Contributor Author

ok now I'm done- added:

  • warning that a passed-in defaults object will be mutated
  • caveat about performance at the end (uses synchronous fs stuff so don't put it somewhere silly)

@mikermcneil
Copy link
Contributor Author

fixed some typos, good to go now

@dominictarr
Copy link
Owner

Awesome pull request!

Just 2 things: you can have nested objects in ini, but it works different:
instead basically, you have dotted paths, instead of nested sections.

{
 "foo": {"bar": {"baz": "value"}}
}

can be represented in ini as:

[foo.bar]
baz = value

see: https://github.com/isaacs/ini#usage

this is also described in the wikipedia page http://en.wikipedia.org/wiki/INI_file#Hierarchy

The third argument is incase you really want to use a different opts parser: #12

can you fix these two points and I'll merge!

@mikermcneil
Copy link
Contributor Author

Good to know, thanks!

@mikermcneil
Copy link
Contributor Author

okie dokie, that should clear it up. Apologies on the delay!

@dominictarr
Copy link
Owner

cool, merging!

dominictarr added a commit that referenced this pull request Jan 16, 2014
@dominictarr dominictarr merged commit 8df6ca1 into dominictarr:master Jan 16, 2014
@dominictarr
Copy link
Owner

merged into 0.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants