gpg-ts
Version:
GPG encryption and decryption in node.js by way of the gpg command-line tool. Now with TypeScript.
24 lines (23 loc) • 1.07 kB
TypeScript
/// <reference types="node" />
import { Readable, Writable } from 'stream';
/**
* Wrapper around spawning GPG. Handles stdout, stderr, and default args.
*
* @param {String} input Input string. Piped to stdin.
* @param {Array} defaultArgs Default arguments for this task.
* @param {Array} args Arguments to pass to GPG when spawned.
* @param {Function} cb Callback. Last parameter of the callback is stderr.
*/
export declare function spawnGPG(input: string | Buffer, defaultArgs: string[], args: string[], cb: (err: Error, msg: Buffer, error: string) => void): void;
/**
* Similar to spawnGPG, but sets up a read/write pipe to/from a stream.
*
* @param {Object} options Options. Should have source and dest strings or streams.
* @param {Array} args GPG args.
* @param {Function} cb Callback
*/
export declare function spawnStreamingGPG(options: Opts, args: string[], cb: (err: Error, stream: Writable) => void): void;
export interface Opts {
source?: string | Readable;
dest?: string | Writable;
}