Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/pass_cli_wrapper/mod.ts>fieldFor

A very crappy tiny Deno script for accessing secrets in a password-store via the pass CLI.
Go to Latest
function fieldFor
import { fieldFor } from "https://deno.land/x/pass_cli_wrapper@0.1.0/mod.ts";

Equivalent to retrieving the contents and looking for a line that starts with ${fieldName}: (the fieldName argument followed by a colon). The remainder of the line (everything after the first colon) will be trimmed and returned.

For example, if you run pass google.com/personal and get the following output:

hunter2 username: johnsmith full_email:johnsmith@gmail.com app_password: abcd 1234 efgh 5678

Then fieldFor("google.com/personal", "app_password") would return abcd 1234 efgh 5678.

Parameters

entry: string
fieldName: string

Returns

Promise<string | undefined>