But because of below code
In Nativescript an error saying Failed to find module: "crypto" is coming.With a bit of search in internet, I found that crypto module support is not added in Nativescript.
Now I'm wondering are there any other ways.
Thanks In Advance.
As NativeScript does not (yet) "polyfill" a crypto module this could be a hard thing.
Searching the code for references to
crypto, you'll find that there's not that many uses and the uses are not that advanced. What this means is that you should be able to substitute the Node module crypto with crypto-js which works in a NativeScript environment.
You might need to fork the AWS SDK codebase and substitute the calls to the Node crypto module with calls to the corresponding methods in crypto-js. Unfortunately they do not share the same API.
If you're running Webpack (or anything like it) you should be able to create a "transformer module" which will transform Node crypto calls to the corresponding crypto-js calls and then make sure your transformer module is called instead of the Node crypto module via Webpack alias'.