Skip to content

Commit

Permalink
updated readme and package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
JPeer264 committed Nov 2, 2016
1 parent 3becfda commit 7ba282b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "json-extra",
"version": "0.0.3",
"description": "> 'json-extra' gives you a little more power to json files and strings",
"version": "0.0.4",
"description": "json-extra gives you a little more power to json files and strings",
"main": "index.js",
"scripts": {
"test": "mocha --recursive",
Expand Down
15 changes: 12 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
> 'json-extra' gives you a little more power to json files and strings
## Getting started
```shell

```sh
npm install --save json-extra
```

or

```sh
yarn add json-extra
```

## Usage

With `json-extra` you can do such things like read json files and directly parse them into an object or just create a new json file.
Expand All @@ -30,6 +37,7 @@ var json = require('json-extra');
- [create](#create)
- [createSync](#create)


### check()

**check([type,] json)**
Expand Down Expand Up @@ -88,8 +96,8 @@ var json = require('json-extra')

json.readToObj('/path/to/json', function(err, data) {
if (err) return console.error(err)
console.log('My nice data: ')
console.log(data)

console.log('My nice data: ', data)
}) // read a json file and return an object
```

Expand All @@ -107,6 +115,7 @@ var json = require('json-extra')
// created a new json file
json.create('/any/path/you/want', 'filename.json', '{json: "string or object"}', function(err) {
if (err) return console.error(err)

console.log('Created!');
})
```
Expand Down

0 comments on commit 7ba282b

Please sign in to comment.