Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-crypto-random

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-crypto-random - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

dist/jscrandom.bundle.js

7

package.json
{
"name": "js-crypto-random",
"version": "0.1.1",
"version": "0.1.2",
"description": "Universal Module for Secure Random Generator in JavaScript",
"main": "dist/index.js",
"main": "dist/jscrandom.bundle.js",
"scripts": {
"test": "./node_modules/.bin/mocha --require @babel/register --recursive $(find test -name '*.spec.js')",
"karma": "./node_modules/.bin/karma start",
"build": "NODE_ENV=production ./node_modules/.bin/babel src -d dist/ --keep-file-extension"
"webpack": "./node_modules/.bin/webpack --optimize-minimize --mode production",
"build": "NODE_ENV=production ./node_modules/.bin/babel src -d dist/ --keep-file-extension && npm run webpack"
},

@@ -11,0 +12,0 @@ "author": "Jun Kurihara",

@@ -44,13 +44,3 @@ Universal Module for Secure Random Generator in JavaScript

## How to bundle scripts importing this module via Webpack
When you bundle files importing this module via Webpack for web, the bundler tries to simultaneously bundle modules that are compatible to some native modules of Node.js, i.e., those in`node-libs-browser` module. But this module automatically chooses the native `crypto` module in Node.js and `crypto.subtle` of Web API in browsers by checking its running environment, and hence the bundled modules of `node-libs-browser` are redundant. From this observation, you should exclude them wen you create bundle scripts importing this module. In particular, the `externals` option of `webpack.config.js` is useful as follows.
```javascript
{
externals: {
'crypto': true
}
}
```
# License
Licensed under the MIT license, see `LICENSE` file.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc