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

Update readme.md #30

Merged
merged 1 commit into from
Sep 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

JSON has a good spec, is implemented in every language, has easy to read syntax and is much more powerful than ini files.

JSON is perfect for writing config files, except of one problem - there is no comments, but sometimes config files get large and need to be commented.
JSON is perfect for writing config files, except of one problem - there are no comments, but sometimes config files get large and need to be commented.

Well, you could just evaluate json file as a JavaScript using one-liner, right?

Expand Down Expand Up @@ -35,7 +35,7 @@ Example of such shiny config file:
Load config file from given path, array of paths or directory. Second parameter is optional and can be a boolean or object.

- `path` {String|Array} absolute path to the file, array of paths or directory
- `options` {Boolean|Object} optional options. If you pass `true` as second param, its the same like ` {merge: true}` and will merge all configs together.
- `options` {Boolean|Object} optional options. If you pass `true` as second param, its the same as `{merge: true}` and will merge all configs together.


`options` defaults:
Expand Down Expand Up @@ -112,18 +112,18 @@ var object = cjson.extend({}, object1, object2);
### cjson.decomment(str)

Remove JavaScript style comments, singleline - '//' and multiline - '/**/'. It takes care
about comments inside of strings and escaping.
of comments inside of strings and escaping.

### cjson.parse(str, [reviver])

Like `JSON.parse`, but it takes care about comments. Optional `reviver` argument
Like `JSON.parse`, but it takes care of comments. Optional `reviver` argument
is for `JSON.parse` method and will be called for every key and value at every level
of the final result
of the final result.

### cjson.replace(str, obj)

Replace all strings `{{key}}` contained in `{key: 'value'}`, where `key` can be any
property of passed `obj`.
property of the passed `obj`.

Example:
```javascript
Expand Down