Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
gnomejs/spawnthe age module provides a simple way to execute age commands.
This package works with Node.js, Deno, Bun
JSR Score
100%
Published
2 months ago (0.0.1)
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879import { 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); }