summaryrefslogtreecommitdiffstats
path: root/test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test.js')
-rw-r--r--test.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..8265683
--- /dev/null
+++ b/test.js
@@ -0,0 +1,25 @@
+var path = require('path');
+
+var gitbook = require('./lib');
+var NodeFS = require('./lib/fs/node');
+
+
+var BASE_PATH = path.join(__dirname); //, 'docs');
+
+// Create a filesystem to read the book
+var fs = NodeFS(BASE_PATH);
+
+// Create a book instance
+var book = gitbook.Book.createForFS(fs);
+
+// Parse the book
+gitbook.Parse.parseBook(book)
+.then(function(_book) {
+ return gitbook.Parse.parsePagesList(_book);
+})
+.then(function(pages) {
+ //console.log('parsed', pages);
+}, function(err) {
+ console.log('error:', err.stack);
+});
+