Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to typescript #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Node.js Package

on:
push:
branches:
- master

jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
version:
needs: publish-npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- run: npm version patch -m "publish %s [ci skip]"
- run: git push --set-upstream origin $(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Node.js Package

on:
pull_request:
branches:
- master

jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.DS_Store
node_modules/

.idea/

dist/
.envrc
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
(The MIT License)

Copyright (c) 2020 Stevan Dedovic

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----

This software was ported from node-gpg.

Copyright (c) 2015 Nicholas Penree <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# GPG Encryption/Decryption in Node.js
[![travis][travis-image]][travis-url]
[![ci][ci-image]][ci-url]
[![npm][npm-image]][npm-url]
[![downloads][downloads-image]][downloads-url]

[travis-image]: https://travis-ci.org/drudge/node-gpg.svg?branch=master
[travis-url]: https://travis-ci.org/drudge/node-gpg
[ci-image]: https://github.com/sdedovic/node-gpg-ts/workflows/Node.js%20Package/badge.svg
[ci-url]: https://github.com/sdedovic/node-gpg-ts/actions?workflow=Node.js+Package

[npm-image]: https://img.shields.io/npm/v/gpg.svg?style=flat
[npm-url]: https://npmjs.org/package/gpg
[npm-image]: https://img.shields.io/npm/v/gpg-ts.svg?style=flat
[npm-url]: https://npmjs.org/package/gpg-ts

[downloads-image]: https://img.shields.io/npm/dm/gpg.svg?style=flat
[downloads-url]: https://npmjs.org/package/gpg
This is a port of the original [`node-gpg`](https://github.com/drudge/node-gpg) to TypeScript. It has been tested with Node 12 and TypeScript 3.9.

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.
Expand All @@ -23,17 +21,17 @@ In order to use Node-GPG, you'll need to have the `gpg` binary in your $PATH.

## Installation

npm install gpg
npm install gpg-ts

## 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.
See [the source](src/gpg.ts) 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)`.
calling `GPG.call(stdinStr, argsArray, cb)`, or `GPG.callStreaming(inputFileName, outputFileName, argsArray, cb)`.

## Notes

Expand Down
132 changes: 0 additions & 132 deletions lib/spawnGPG.js

This file was deleted.

Loading