word-extractor
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -0,1 +1,8 @@ | ||
### 0.1.4 / 25th March 2017 | ||
* Fixed a documentation issue. `extract` returns a Promise. See #6 | ||
* Corrected table cell delimiters to be tabs. See #9 | ||
* Fixed an issue where replacements weren't being applied right. | ||
### 0.1.3 / 6th July 2016 | ||
@@ -6,2 +13,3 @@ | ||
### 0.1.1 / 17th January 2016 | ||
@@ -8,0 +16,0 @@ |
@@ -0,1 +1,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
var Document, filters, | ||
@@ -49,3 +50,3 @@ slice = [].slice; | ||
if (match.length === 1) { | ||
replaced = filters[match.charPointAt(0)]; | ||
replaced = filters[match.charCodeAt(0)]; | ||
if (replaced === 0) { | ||
@@ -63,3 +64,3 @@ return ""; | ||
matcher = /(?:[\x02\x05\x07\x08\x0a\x0d\u2018\u2019\u201c\u201d\u2002\u2003\u2012\u2013\u2014]|\x13(?:[^\x14]*\x14)?([^\x15]*)\x15)/g; | ||
return text.replace(replacer); | ||
return text.replace(matcher, replacer); | ||
}; | ||
@@ -66,0 +67,0 @@ |
@@ -0,1 +1,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
var filters; | ||
@@ -2,0 +3,0 @@ |
@@ -0,1 +1,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
var translations; | ||
@@ -2,0 +3,0 @@ |
@@ -0,1 +1,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
var Buffer, Document, Promise, WordExtractor, filters, oleDoc, translations; | ||
@@ -2,0 +3,0 @@ |
{ | ||
"name": "word-extractor", | ||
"version": "0.1.3", | ||
"description": "Node.js package to read Word .DOC files", | ||
"version": "0.1.4", | ||
"description": "Node.js package to read Word .doc files", | ||
"main": "lib/word.js", | ||
"scripts": { | ||
"test": "node_modules/.bin/gulp test" | ||
"build": "coffee -b -o lib src", | ||
"test": "mocha --sort --recursive --compilers coffee:coffee-script/register ./test" | ||
}, | ||
@@ -26,6 +27,2 @@ "repository": { | ||
"coffee-script": "^1.8.0", | ||
"gulp": "^3.8.10", | ||
"gulp-coffee": "^2.2.0", | ||
"gulp-if": "^2.0.0", | ||
"gulp-mocha": "^2.0.0", | ||
"mocha": "^2.2.5" | ||
@@ -32,0 +29,0 @@ }, |
@@ -10,3 +10,3 @@ ### word-extractor | ||
This module is intended to provide a much faster way of reading the next from a Word file, without leaving the node.js environment. | ||
This module is intended to provide a much faster way of reading the text from a Word file, without leaving the node.js environment. | ||
@@ -18,6 +18,8 @@ | ||
var extractor = new WordExtractor(); | ||
var doc = extractor.extract("file.doc") | ||
var body = doc.getBody(); | ||
var extracted = extractor.extract("file.doc"); | ||
extracted.then(function(doc) { | ||
console.log(doc.getBody()); | ||
}); | ||
The object returned from the `extract()` method is a document object, and provides several views onto different parts of the document contents. | ||
The object returned from the `extract()` method is a promise that resolves to a document object, which then provides several views onto different parts of the document contents. | ||
@@ -29,3 +31,3 @@ | ||
Main method to open a Word file and retrieve the data. Returns a `Document`. | ||
Main method to open a Word file and retrieve the data. Returns a promise which resolves to a `Document`. | ||
@@ -51,4 +53,4 @@ `Document#getBody()` | ||
Copyright (c) 2016. Stuart Watt. | ||
Copyright (c) 2016-2017. Stuart Watt. | ||
Licensed under the MIT License. |
Sorry, the diff of this file is not supported yet
978609
4
39
1229
53