-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minified forge does not require node crypto #783
Comments
The minified code is meant to be used in a browser. When using Node.js you should use The node/browser switching code is rather ancient. It predates all modern tools. When the code gets a major refactor it's likely newer constructs will be used. It's a bit tricky in the case of |
We use minified forge for crypto in https://github.com/gchq/CyberChef which is a webapp but for unit testing we use a node environment so tests for individual operations which rely on minified forge don't work. |
There are legitimate use cases where code is at least bundled as a single file (usually using webpack and maybe even babel) in nodejs, such as more easily distributing code - many times by including a single output js file in a nexe build. |
I'm not sure what the issue is but from inspecting the minified JS for forge, it does not run the
require('crypto')
even if forge determines the environment is Node.The text was updated successfully, but these errors were encountered: