paixaop / node-sodium

Port of the lib sodium encryption library to Node.js
MIT License
351 stars 126 forks source link

Angular/typescript usage #143

Open grosch opened 5 years ago

grosch commented 5 years ago

Are there examples of how to use this with angular?

paixaop commented 5 years ago

Not that I know of. Never used it in the browser.

On Mon, Dec 3, 2018 at 00:52 grosch notifications@github.com wrote:

Are there examples of how to use this with angular?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/paixaop/node-sodium/issues/143, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT9XkF_2ZqiE-QE1HgpBc14DmuPW0xIks5u1LwygaJpZM4Y969E .

-- Do It Right or Don't Do It At All!

grosch commented 5 years ago

After doing the npm install sodium I did my ng build but I get a bunch of errors like so:

ERROR in ./node_modules/sodium/lib/keys/dh-key.js Module not found: Error: Can't resolve '../../build/Release/sodium' in '/Users/scott/VoiceTalentBank/node_modules/sodium/lib/keys'

I'm doing this on macOS Mojave. During the install I saw a bunch of warnings about deprecated methods being called but it did succeed.

paixaop commented 5 years ago

The deprecations are from libsodium and should not cause issues. It seems that NG cannot find the binary module for sodium. Can you check the build directory under node sodium to see if it is there after node sodium install runs successfully?

grosch commented 5 years ago
% find . -name libsodium.a
./node_modules/sodium/deps/libsodium/src/libsodium/.libs/libsodium.a
./node_modules/sodium/deps/build/lib/libsodium.a
% pushd node_modules/sodium/lib/keys
% ls ../../build/Release/
nothing.a    obj.target/  sodium.node* 
nachozt commented 4 years ago

I get the same errors. Any work around for using it with angular?

rawr51919 commented 4 years ago

Could these errors be related to issues #144 and #146?