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)
function generateSecret
generateSecret(
length: number,
characters?: string,
): string

Generates a secret string of the specified length using the given characters. If no characters are provided, the default character set will be used.

Parameters

length: number
  • The length of the secret string to generate.
optional
characters: string
  • Optional. The characters to use for generating the secret string.

Return Type

The generated secret string.

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 { generateSecret } from "@gnome/secrets/generator";
or

Import directly with a jsr specifier

import { generateSecret } 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 { generateSecret } 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 { generateSecret } from "@gnome/secrets/generator";

Add Package

vlt install jsr:@gnome/secrets

Import symbol

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

Add Package

npx jsr add @gnome/secrets

Import symbol

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

Add Package

bunx jsr add @gnome/secrets

Import symbol

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