Permalink
Browse files

[minor] added two examples

  • Loading branch information...
nicoreed
nicoreed committed Jun 20, 2011
1 parent dc6a8ea commit 3bb418f86f241a209394f04e91d1d78d9d5691b3
Showing with 34 additions and 0 deletions.
  1. +23 −0 examples/string-object-rows.js
  2. +11 −0 examples/string-rows.js
@@ -0,0 +1,23 @@
+/*
+ * put-object-rows.js: Example usage for `cliff.putObjectRows`.
+ *
+ * (C) 2010, Nodejitsu Inc.
+ *
+ */
+
+var cliff = require('../lib/cliff');
+
+var objs = [], obj = {
+ name: "bazz",
+ address: "1234 Nowhere Dr.",
+};
+
+for (var i = 0; i < 10; i++) {
+ objs.push({
+ name: obj.name,
+ address: obj.address,
+ id: Math.random().toString()
+ });
+}
+
+console.log(cliff.stringifyObjectRows(objs, ['id', 'name', 'address']));
View
@@ -0,0 +1,11 @@
+var cliff = require('../lib/cliff');
+
+var rows = [
+ ['Name', 'Flavor', 'Dessert'],
+ ['Alice', 'cherry', 'yogurt'],
+ ['Bob', 'carmel', 'apples'],
+ ['Joe', 'chocolate', 'cake'],
+ ['Nick', 'vanilla', 'ice cream']
+];
+
+console.log(cliff.stringifyRows(rows));

0 comments on commit 3bb418f

Please sign in to comment.