How is my SDK global config provided?

If you follow my tweets/rants you’ll know I’ve been dabbling in NodeJS recently - specifically to build a CLI tool (and potentially more) around some reporting work I’m doing.

One of the features I have in this CLI tool is the ability to self-review local configuration; think git config of sorts. In my case I’d like to know things about SDK configuration (AWS) and potentially a series of external API dependencies. This is a simple guide to determining how your AWS SDK global config credentials have been configured using native EC6 promises.

I’ve been using ronin as a scaffold for this. And have a simple myapp.js config list command which lists out details of configuration.

Note: If you want to use ronin you’ll find its undocumented that you need yo installed.

My big question: Is my SDK configured, and how is it configured?

I managed to self-answer my own stack overflow post so I’m writing up a comparison of approaches as a more detailed answer.

From here on in I deep-dive into code (so I’ll forgo my usual rambling commentary)