JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4614
  • Score
    100M100P100Q176558F
  • License MIT

SOPS Decoder for JavaScript (Node)

Package Exports

  • sops-decoder

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sops-decoder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

SOPS Decoder for JavaScript (Node)

This is a decoder for SOPS encoded files. This lightweight encoder makes it easy to embed in your AWS Lambda functions or Docker images without having to bring along the whole Go package.

Note: The deocodeFile() method only supports JSON input.

Installation

npm install --save sops-decoder

Quick Start

    const sopsDecode = require('sops-decoder');

    try {
      const data = await sopsDecode.decodeFile('secure.json.enc');

      // do something with the data
    } catch (err) {
      // log a great error
    }

API

interface Tree {
  [key: string]: any;
}

//
// Take the given path as JSON and read the file contents and then call decode on the result
//
decodeFile(path: string): Promise<Tree>

//
// Run the given tree through the SOPS decoder and return a "plaintext" version of the
//   result
//
decode(tree: Tree): Promise<Tree>

TODO

  • PGP Key support
  • Unit Testing