This plugin changes content of json file if keywords match with environment variables
Environment variable used by this insomnia plugin is json_property has json structure:
{
"json_property": {
"key1": "value1",
"key2": "value2"
}
}
Each json_property environment variable key should match the property key from json file, property value will be changed to the one from environment variable value. The original imported file won't be modified unless 'Save changed file content' checkbox is enabled.
If no json_property provided the file content will be imported as is.
Json file content editing is done using edit-json-file library.
- Checkout this repository;
- run
npm i
- Copy source code to insomnia plugins directory(see paths below);
- Create environment variables(see structure above) with your values;
-
MacOS: ~/Library/Application\ Support/Insomnia/plugins/
-
Windows: %APPDATA%\Insomnia\plugins\
-
Linux: $XDG_CONFIG_HOME/Insomnia/plugins/ or ~/.config/Insomnia/plugins/
Write Tests- Publish plugin to npm
Give the optional flag to rewrite the json file content