Permalink
Browse files

string example

  • Loading branch information...
1 parent 2b364f1 commit 85dac0078ff87d03413f8818a32187e5dc886762 @substack committed Feb 13, 2012
Showing with 33 additions and 1 deletion.
  1. +28 −0 README.markdown
  2. +4 −0 example/string.js
  3. +1 −1 package.json
View
@@ -6,6 +6,23 @@ Create colorful diffs for javascript objects.
example
=======
+string.js
+---------
+
+``` js
+var difflet = require('difflet');
+
+var s = difflet.compare({ a : 2, c : 5 }, { a : 3, b : 4 });
+process.stdout.write(s);
+```
+
+output:
+
+![colorful output](http://substack.net/images/screenshots/difflet_string.png)
+
+colors.js
+---------
+
``` js
var diff = require('difflet')({ indent : 2 });
@@ -59,6 +76,17 @@ diff(prev, next)
Return a stream with the colorful changes between objects `prev` and `next`.
+diff.compare(prev, next)
+------------------------
+
+Return a string with the colorful changes between `prev` and `next`.
+
+difflet.compare(prev, next)
+---------------------------
+
+Return a string with the colorful changes between `prev` and `next` with the
+default options.
+
install
=======
View
@@ -0,0 +1,4 @@
+var difflet = require('../');
+
+var s = difflet.compare({ a : 2, c : 5 }, { a : 3, b : 4 });
+process.stdout.write(s);
View
@@ -1,7 +1,7 @@
{
"name" : "difflet",
"description" : "colorful diffs for javascript objects",
- "version" : "0.0.2",
+ "version" : "0.1.0",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/difflet.git"

0 comments on commit 85dac00

Please sign in to comment.