Skip to content

Commit 7ba282b

Browse files
committed
updated readme and package.json
1 parent 3becfda commit 7ba282b

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "json-extra",
3-
"version": "0.0.3",
4-
"description": "> 'json-extra' gives you a little more power to json files and strings",
3+
"version": "0.0.4",
4+
"description": "json-extra gives you a little more power to json files and strings",
55
"main": "index.js",
66
"scripts": {
77
"test": "mocha --recursive",

readme.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66
> 'json-extra' gives you a little more power to json files and strings
77
88
## Getting started
9-
```shell
9+
10+
```sh
1011
npm install --save json-extra
1112
```
1213

14+
or
15+
16+
```sh
17+
yarn add json-extra
18+
```
19+
1320
## Usage
1421

1522
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.
@@ -30,6 +37,7 @@ var json = require('json-extra');
3037
- [create](#create)
3138
- [createSync](#create)
3239

40+
3341
### check()
3442

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

8997
json.readToObj('/path/to/json', function(err, data) {
9098
if (err) return console.error(err)
91-
console.log('My nice data: ')
92-
console.log(data)
99+
100+
console.log('My nice data: ', data)
93101
}) // read a json file and return an object
94102
```
95103

@@ -107,6 +115,7 @@ var json = require('json-extra')
107115
// created a new json file
108116
json.create('/any/path/you/want', 'filename.json', '{json: "string or object"}', function(err) {
109117
if (err) return console.error(err)
118+
110119
console.log('Created!');
111120
})
112121
```

0 commit comments

Comments
 (0)