From 7102fcc4ddec11e2d33205866f9f18df14e5aeb5 Mon Sep 17 00:00:00 2001 From: Josh Duff Date: Mon, 26 Sep 2016 21:00:25 -0500 Subject: [PATCH] Readme maintenance + tests - drop the examples folder - use jsmd to test the readme example - drop the bower section from the readme --- README.markdown | 34 ++++++++++++++++------------------ example/merge.js | 5 ----- package.json | 3 ++- 3 files changed, 18 insertions(+), 24 deletions(-) delete mode 100644 example/merge.js diff --git a/README.markdown b/README.markdown index 6b1d5ff..0de708e 100644 --- a/README.markdown +++ b/README.markdown @@ -6,31 +6,30 @@ Merge the enumerable attributes of two objects deeply. example ======= -```js -var util = require('util') -var merge = require('deepmerge') + +```js var x = { foo: { bar: 3 }, array: [ { does: 'work', too: [ 1, 2, 3 ] } ] } var y = { foo: { baz: 4 }, quux: 5, array: [ { does: 'work', too: [ 4, 5, 6 ] }, { really: 'yes' } ] } -console.log(util.inspect(merge(x, y), false, null)) -``` - -output: - -```js -{ foo: { bar: 3, baz: 4 }, +var expected = { foo: { bar: 3, baz: 4 }, array: [ { does: 'work', too: [ 1, 2, 3, 4, 5, 6 ] }, { really: 'yes' } ], quux: 5 } + +merge(x, y) // => expected ``` methods ======= +``` var merge = require('deepmerge') +``` merge(x, y) ----------- @@ -50,21 +49,20 @@ install With [npm](http://npmjs.org) do: -``` +```sh npm install deepmerge ``` -For the browser, you can install with [bower](http://bower.io/): - -``` -bower install deepmerge -``` - test ==== With [npm](http://npmjs.org) do: -``` +```sh npm test ``` + +license +======= + +MIT diff --git a/example/merge.js b/example/merge.js deleted file mode 100644 index ccac0a4..0000000 --- a/example/merge.js +++ /dev/null @@ -1,5 +0,0 @@ -var merge = require('../') -var x = { foo : { 'bar' : 3 } } -var y = { foo : { 'baz' : 4 }, quux : 5 } -var merged = merge(x, y) -console.dir(merged) diff --git a/package.json b/package.json index 59eb1f7..330cfc8 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,11 @@ "node": ">=0.4.0" }, "scripts": { - "test": "tap test/*.js" + "test": "tap test/*.js && jsmd README.markdown" }, "dependencies": {}, "devDependencies": { + "jsmd": "0.3.1", "tap": "~0.4.8" }, "license": "MIT"