Skip to content

Commit 69dbe3c

Browse files
committed
Merge branch 'gh-pages' of github.com:johanneswilm/diffDOM into gh-pages
2 parents f15c8ba + 5b628f8 commit 69dbe3c

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This project is licensed under the LGPL v. 3. For details see LICENSE.txt.
1212

1313
## Demo and tests
1414

15-
Check http://johanneswilm.github.io/diffDOM for demo and tests.
15+
Check http://fiduswriter.github.io/diffDOM for demo and tests.
1616

1717
## Usage
1818

@@ -21,6 +21,11 @@ Include the diffDOM.js file in your HTML like this:
2121
<script src="diffDOM.js">
2222
```
2323

24+
Or like this in node/browserify:
25+
```
26+
var diffDOM = require("diffDOM");
27+
```
28+
2429
Then create an instance of diffDOM within the javascript code:
2530
```
2631
dd = new diffDOM();

diffDOM.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,5 +903,14 @@
903903
},
904904
};
905905

906-
window.diffDOM = diffDOM;
907-
}());
906+
if (typeof exports !== 'undefined') {
907+
if (typeof module !== 'undefined' && module.exports) {
908+
exports = module.exports = diffDOM;
909+
}
910+
exports.diffDOM = diffDOM;
911+
} else {
912+
// `window` in the browser, or `exports` on the server
913+
this.diffDOM = diffDOM;
914+
}
915+
916+
}.call(this));

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "diffDOM",
3+
"version": "0.0.1",
4+
"description": "A diff for DOM elements, as client-side JavaScript code. Gets all modifications, insertions and removals between two DOM fragments.",
5+
"main": "diffDOM.js",
6+
"directories": {
7+
"test": "tests"
8+
},
9+
"scripts": {
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git://github.com/fiduswriter/diffDOM.git"
15+
},
16+
"author": "Johannes Wilm [email protected]",
17+
"license": "LGPL",
18+
"bugs": {
19+
"url": "https://github.com/fiduswriter/diffDOM/issues"
20+
}
21+
}

0 commit comments

Comments
 (0)