Skip to content

bicycle-codes/randombytes

Repository files navigation

randombytes

tests types module semantic versioning Common Changelog install size dependencies license

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.

Contents

install

Installation instructions

npm i -S @namespace/package

API

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 ./public

HTML

<script type="module" src="./module.min.js"></script>

About

Random bytes for the browser or node

Resources

License

Stars

Watchers

Forks

Packages

No packages published