Skip to main content
Home

Built and signed on GitHub Actions

The secrets module provides a secret generator, a secret masker, a Vault interface, and two vault implementations: json and memory.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (0.2.0)
class DefaultSecretGenerator

Represents a default secret generator.

Constructors

new
DefaultSecretGenerator()

Creates an instance of DefaultSecretGenerator.

Methods

add(value: string): this

Adds characters to the secret generator.

Adds default characters to the secret generator.

Generates a secret as a string.

Generates a secret as a Uint8Array.

setValidator(validator: (value: Uint8Array) => boolean): this

Sets a custom validator function for generated secrets.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@gnome/secrets

Import symbol

import { DefaultSecretGenerator } from "@gnome/secrets/generator";
or

Import directly with a jsr specifier

import { DefaultSecretGenerator } from "jsr:@gnome/secrets/generator";

Add Package

pnpm i jsr:@gnome/secrets
or (using pnpm 10.8 or older)
pnpm dlx jsr add @gnome/secrets

Import symbol

import { DefaultSecretGenerator } from "@gnome/secrets/generator";

Add Package

yarn add jsr:@gnome/secrets
or (using Yarn 4.8 or older)
yarn dlx jsr add @gnome/secrets

Import symbol

import { DefaultSecretGenerator } from "@gnome/secrets/generator";

Add Package

vlt install jsr:@gnome/secrets

Import symbol

import { DefaultSecretGenerator } from "@gnome/secrets/generator";

Add Package

npx jsr add @gnome/secrets

Import symbol

import { DefaultSecretGenerator } from "@gnome/secrets/generator";

Add Package

bunx jsr add @gnome/secrets

Import symbol

import { DefaultSecretGenerator } from "@gnome/secrets/generator";