gwjjeff/cryptojs

Unexpected String when requiring

dylanh724 opened this issue · 0 comments

package.json
"cryptojs": "^2.5.3",

$ node server.js

/home/dylan/tol-node/tol/server.js:9
var Crypto = (require 'cryptojs').Crypto // Same as the readme?
                      ^^^^^^^^^^
SyntaxError: Unexpected string

Almost seems like I didn't install it, but it's there. I tried npm install just in case dependencies got lost, but all seems well. Running on Ubuntu. Any thoughts?

PS -- Although it failed at the init, I'm trying to do this:

var hash = Crypto.enc.Base64.stringify( Crypto.HmacSHA256(nonce, secret) );

This is how I did it with cryptojs in non-node .. I can do the same, right?