From 7ba282bdc13ff06934784850675101356795430c Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Wed, 2 Nov 2016 23:17:40 +0100 Subject: [PATCH] updated readme and package.json --- package.json | 4 ++-- readme.md | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 95b2e7b..64cdf44 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/readme.md b/readme.md index 02b5387..1ee0db4 100644 --- a/readme.md +++ b/readme.md @@ -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. @@ -30,6 +37,7 @@ var json = require('json-extra'); - [create](#create) - [createSync](#create) + ### check() **check([type,] json)** @@ -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 ``` @@ -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!'); }) ```