@bicycle-codes/randombytes
v0.0.5
Published
Random bytes for the browser or node
Readme
randombytes
Get random bytes as a Uint8Array, using the same API in either Node or browsers.
Under the hood this will use the node:crypto library if used in node, or crypto.getRandomValues in the browser.
install
Installation instructions
npm i -S @namespace/packageAPI
This exposes ESM and common JS via package.json exports field.
ESM
import '@namespace/package/module'Common JS
require('@namespace/package/module')CSS
Import CSS
import '@namespace/package-name/css'Or minified:
import '@namespace/package-name/css/min'Customize CSS via some variables
component-name {
--example: pink;
}use
usage instructions here
JS
import '@namespace/package/module'pre-built JS
This package exposes minified JS files too. Copy them to a location that is accessible to your web server, then link to them in HTML.
copy
cp ./node_modules/@namespace/package/dist/module.min.js ./publicHTML
<script type="module" src="./module.min.js"></script>