npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

configur8

v1.2.3

Published

Inject values into your structured text doc from remote or CLI sources.

Downloads

44

Readme

Summary

Inject values into your structured text doc.

Value Lookup

Below is a list of prefixes you can use to indicate the location of the value to be looked up. WHen any of these value syntaxes are found as a value, then it will replace the entirety of the value when its located and if not located, it will be removed from the document.

  • cli:NAME_TO_LOOKUP Will look for a command line argument passed in with the name specified. a0deploy-variables --config ./file.yaml --output ./file.dev.yaml --NAME_TO_LOOKUP HELLO
  • aws-secretmanager:/path/to/secret:VALUE_IN_SECRETS This will lookup a secret bundle called /path/to/secret and within that bundle, it will look for a value called VALUE_IN_SECRETS. Currently this value must be a string.
  • aws-parameterstore:/path/to/parameter This will lookup a parameters called /path/to/parameter in AWS Parameter Storer. Currently this value must be a string.

String Array

Its possible to format your value as a list of string values separated by a comma. If so, you can end your varaiable pattern with an @ symbol to tell configur8 to insert a list of string's instead of a single string value.

Inline Replacement

In all cases where parenthesis are omitted, the value foudn will replace the value the value lookup is within. If you specify braces around the value lookup pattern, then only that section is replaced.

For example (cli:FOO_TOO) Or Some Other Default, where FOO_TOO = Genius will resolve to Genius Or Some Other Default. Can be useful when needing a reference, within another lookup pattern, or where values simply need to be augmented not replaced.

Usage

  1. Install npm i -g structured-doc-vars aws-sdk
  2. View the CLI options doc-vars --help

AWS

Configurations

  • AWS_DEFAULT_REGION Will be used to define the region when initializing AWS service clients.
  • AWS_REGION Will be used to define the region when initializing AWS service clients. Takes preference over AWS_DEFAULT_REGION.
  • AWS_PROFILE The profile from the AWS .credentials file to use when initializing clients for AWS services.
  • AWS_ACCESS_KEY_ID The access key id to use when initalizing clients for aws services. Will not be used if AWS_PROFILE is provided. If provided so must AWS_SECRET_ACCESS_KEY.
  • AWS_SECRET_ACCESS_KEY The access key id to use when initalizing clients for aws services. Will not be used if AWS_PROFILE is provided. If provided so must AWS_ACCESS_KEY_ID.
  • AWS_SESSION_TOKEN Optional. Must be provided if using an STS token. Is only utilized when providing AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
  • AWS_HTTPS_ALLOW_INVALID_CERTS If provided, invalid certificates will be ignored by creating a custom agent with rejectUnauthorized = false. ie, http.Agent({rejectUnauthorized:false})
  • AWS_HTTPS_CERTS_PATH If provided, the certs at the location specified will be supplied to the http.Agent used for communicating with AWS services.

Permissions

Secrets Manager

You need to ensure that the account you are executing this script with has the appropriate AWS Permissions. Below is an example YAML format on a permission granting access to describe and get secret values from a secret bundle in AWS Secrets Manager.

-  Effect: "Allow"
       Action:
          - "secretsmanager:DescribeSecret"
          - "secretsmanager:GetSecretValue"
       Resource:
          - arn:aws:secretsmanager:{AWS::Region}:{AWS::AccountId}:secret:/path/to/secret*

Parameter Store

TODO

Environment Variables

TODO

  • Update readme to have a cleaner organization around possible value sources.
  • ADD xml support?
  • What other structured document types?
  • Azure Key Vault
  • Ignore popular prefixes like http/s, file, ftp, etc.