
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
aws-secrets-parser
Advanced tools
Fetch and parse JSON from AWS secrets manager.
If I have a JSON secret:
{
"username": "***",
"password": "***"
}
import { retrieve } from "aws-secrets-parser";
retrieve("database-secret", "us-east-1").then(({ username, password }) => { ... });
jq:> aws-secrets-parser database-secret | jq "."
{
"username": "***",
"password": "***"
}
> source <(aws-secrets-parser database-secret --naming constant --prefix DATABASE --output export)
> printenv
DATABASE_USERNAME=***
DATABASE_PASSWORD=***
.env file:> aws-secrets-parser database-secret --naming constant --prefix DATABASE --output dotenv > .env
This produces a .env file with:
DATABASE_USERNAME=***
DATABASE_PASSWORD=***
npm install aws-secrets-parser
To make the cli accessible install the package globally with the -g flag or invoke it with npx.
Fetch and parse a JSON secret:
import { retrieve } from "aws-secrets-parser";
retrieve("database-secret", "us-east-1");
aws-secrets-parser <name>
Fetch and parse JSON from AWS secrets manager.
Positionals:
name The secret name [string]
Options:
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
-r, --region Set the AWS region [string] [default: "us-east-1"]
-n, --naming Set the key naming format [string] [choices: "preserve", "constant", "pascal"] [default: "preserve"]
-p, --prefix Add a prefix to the keys [string]
-P, --postgres Aggregate postgres variables [boolean] [default: false]
-o, --output Set the output format [string] [choices: "json", "export", "dotenv"] [default: "json"]
Naming formats:
preserve → No formattingconstant → CONSTANT_CASEpascal → PascalCaseOutput formats:
json → { ... }export → export key='value'dotenv → key=value> aws-secrets-parser database-secret --naming constant --prefix DATABASE --output export
export DATABASE_USERNAME='***'
export DATABASE_PASSWORD='***'
The cli prints export statements since you can't set environment variables from a script directly. Running the cli with source will consume them:
> source <(aws-secrets-parser database-secret --naming constant --prefix DATABASE --output export)
> printenv
DATABASE_USERNAME=***
DATABASE_PASSWORD=***
You can also output them in dotenv format to consume later:
> aws-secrets-parser database-secret --naming constant --prefix DATABASE --output dotenv > .env
This produces a .env file with:
DATABASE_USERNAME=***
DATABASE_PASSWORD=***
To install dependencies:
yarn install
To run tests:
yarn test
To generate the documentation locally:
yarn docs
To run linters:
yarn lint
To run formatters:
yarn format
Please read this repository's Code of Conduct which outlines our collaboration standards and the Changelog for details on breaking changes that have been made.
This repository adheres to semantic versioning standards. For more information on semantic versioning visit SemVer.
Bump2version is used to version and tag changes. For example:
bump2version patch
Lots of love to the open source community!
FAQs
Fetch and parse JSON from AWS secrets manager.
The npm package aws-secrets-parser receives a total of 816 weekly downloads. As such, aws-secrets-parser popularity was classified as not popular.
We found that aws-secrets-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.