# gpg

> GPG encryption and decryption in node.js by way of the gpg command-line tool

Latest version **0.6.0** (published 2016-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install gpg
pnpm add gpg
yarn add gpg
bun add gpg
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2016-12-08 |
| First published | 2011-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 124 |
| Author | Nicholas Penree |
| Maintainers | drudge, freewil |
| Keywords | gpg, encrypt, decrypt, pgp, gnupg |

## Links

- npm: https://www.npmjs.com/package/gpg
- Repository: https://github.com/drudge/node-gpg
- Homepage: https://github.com/drudge/node-gpg#readme
- Issues: https://github.com/drudge/node-gpg/issues
- npm.io page: https://npm.io/package/gpg

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.6.0 (latest) — 2016-12-08
- 0.5.0 — 2016-12-02
- 0.4.1 — 2016-04-20
- 0.4.0 — 2015-10-11
- 0.3.4 — 2014-06-19
- 0.3.3 — 2014-03-17
- 0.3.2 — 2012-08-21
- 0.3.1 — 2012-08-17
- 0.3.0 — 2012-08-16
- 0.2.1 — 2012-06-29
- 0.2.0 — 2011-09-02
- 0.1.0 — 2011-06-05

## README

# GPG Encryption/Decryption in Node.js [![Build Status](https://travis-ci.org/drudge/node-gpg.svg?branch=master)](https://travis-ci.org/drudge/node-gpg)

This module is a wrapper around `gpg` for use within Node. Node-GPG takes care of spawning `gpg`, passing it
the correct arguments, and piping input to stdin. It can also pipe input in from files and output out to files.

Use Node-GPG if you are considering calling `gpg` directly from your application.

## Requirements

In order to use Node-GPG, you'll need to have the `gpg` binary in your $PATH.

## Installation

    npm install gpg

## Usage

Node-GPG supports both direct calls to GPG with string arguments, and streaming calls for piping input and output
from/to files.

See [the source](lib/gpg.js) for more details.

If a function you need is not implemented, you can call gpg directly with arguments of your choice by
calling `gpg.call(stdinStr, argsArray, cb)`, or `gpg.callStreaming(inputFileName, outputFileName, argsArray, cb)`.

## Notes

Existing implementations of PGP in Javascript are blocking and unfeasibly slow for server use.
In casual testing, encrypting a simple 400-character email to an El-Gamal key took upwards of 11 seconds using
[openpgpjs](https://github.com/openpgpjs/openpgpjs) and 14 seconds with [kbpgp](https://github.com/keybase/kbpgp),
but takes less than 0.1 seconds with `gpg` directly.

## Contributors

The following are the major contributors of `node-gpg` (in no specific order).

  * Nicholas Penree ([drudge](http://github.com/drudge))
  * [freewil](http://github.com/freewil)
  * Samuel Reed [strml](http://github.com/strml)

---
_Source: https://npm.io/package/gpg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
