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.
Latest
function fieldFor
import { fieldFor } from "https://deno.land/x/pass_cli_wrapper@0.3.3/mod.ts";

Equivalent to retrieving the contents and looking for a line that starts with ${field}: (the field 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.

If entry does not exist, an EntryNotFoundError is thrown. If field cannot be found in the entry, a FieldNotFoundError is thrown.

Parameters

entry: string
field: string

Returns

Promise<string>