I want to load the AWS config file and edit the contents of the file.
I found @aws-sdk/shared-ini-file-loader, that works well to load the config file data as the JSON object.
import { loadSharedConfigFiles } from '@aws-sdk/shared-ini-file-loader'
let awsFileContents = await loadSharedConfigFiles({ configFilepath: '~/.aws/config' })
console.log(awsFileContents.configFile)
Now I want to perform some changes in the awsFileContents.configFile
object, parse it back to the correct format, and write it back to the ~/.aws/config
file.
Is there an AWS module available that can do that?
I have tried ini, multi-ini, and conf-cfg-ini. But they have issues while parsing the JSON back to the correct format.