I am parsing wikipedia documents and using the npm html-to-text converter package to extract just the text from various wikipedia pages. I am encountering issues when trying to log / send this content to be used on the client side.
Here is my implementation with the npm package:
var stringer = htmltext.fromString(data, {
wordwrap: 130
});
console.log(stringer) // returns [object Object]
console.log(typeof stringer); // returns string
console.log(util.inspect(stringer)); // returns '[object Object]'
As you can see in the comments, the first console log appears to represent the variable as an object but the second shows that is a string. How can this be?
stringer.toString();.console.dirgave me '[object Object]' andstringer.toString()gave me [object Object]. Not really sure what to make of that.[object Object]? I would look further up the stack, finger pointing at at the library, if your not doing anything else in-between getting the string and logging that is.