Skip to main content

@spawn/age@0.0.1
Built and signed on GitHub Actions

the age module provides a simple way to execute age commands.

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
2 months ago (0.0.1)
Package root>command.ts
import { Command, type CommandArgs, type CommandOptions } from "jsr:@gnome/exec@^0.5.1"; import { pathFinder } from "jsr:/@gnome/exec@^0.5.1/path-finder"; pathFinder.set("age", { name: "age", envVariable: "AGE_EXE", windows: [ "${LOCALAPPDATA}\\Programs\\bin\\age.exe", "${LOCALAPPDATA}\\bin\\age.exe", "${UserProfile}\\bin\\age.exe", "${UserProfile}\\scoop\\shims\\age.exe", "${ALLUSERSPROFILE}\\chocolatey\\bin\\age.exe", "${ChocolateyInstall}\\bin\\age.exe", ], linux: [ "${HOME}/.local/bin/age", "/usr/local/bin/age", "/usr/bin/age", ], }); pathFinder.set("age-keygen", { name: "age-keygen", envVariable: "AGE_KEYGEN_EXE", windows: ["${ChocolateyInstall}\\bin\\age-keygen.exe"], linux: ["/usr/local/bin/age-keygen", "/usr/bin/age-keygen"], }); /** * Represents an age command. */ export class AgeCommand extends Command { /** * Represents the age CLI command. * @param args - The command arguments. * @param options - The command options. */ constructor(args?: CommandArgs, options?: CommandOptions) { super("age", args, options); } } /** * Represents an age-keygen command. */ export class AgeKeygenCommand extends Command { /** * Represents the age-keygen CLI command. * @param args - The command arguments. * @param options - The command options. */ constructor(args?: CommandArgs, options?: CommandOptions) { super("age-keygen", args, options); } } /** * Invokes the `age` cli. * * @param args - The command arguments. * @param options - The command options. * @returns A new instance of the AgeCommand class. * @see {AgeCommand} */ export function age(args?: CommandArgs, options?: CommandOptions): AgeCommand { return new AgeCommand(args, options); } /** * Invokes the `age-keygen` cli. * * @param args - The command arguments. * @param options - The command options. * @returns A new instance of the AgeKeygenCommand class. * @see {AgeKeygenCommand} */ export function ageKeygen(args?: CommandArgs, options?: CommandOptions): AgeKeygenCommand { return new AgeKeygenCommand(args, options); }