Closed bronius closed 5 years ago
@bronius tell your friend that node-xlsx
and xlsx
are in fact different projects. It's confusing. Someone else also published js-xlsx
on npm so it gets even more confusing.
Ok thanks for validating my observation, psychological framework, and even including a little humor. :D I assure you my friend feels better.
Hi - Writing for a friend.. hope it helps someone else.
I was (and am still) mixing up libraries when I found myself banging my head against all examples pointing to
npm install node-xlsx
and then simply citexlsx.utils.XYZ
, but for me,.utils
was not an object. Elsewhere I found this debug snippet:Output of this is:
[ 'parse', 'build', 'default' ]
Ah hah. So I was in fact using the wrong npm. Instead of
node-xlsx
I needed justnode install --save xlsx
and all works as expected.console.log(Object.keys(xlsx));
gives this and .utils gives that. This:That: