Skip to content

alaptseu/insomnia-plugin-jsonfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Insomnia json file template tag

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.

To install plugin manually

  1. Checkout this repository;
  2. run npm i
  3. Copy source code to insomnia plugins directory(see paths below);
  4. 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/

Todos

  • Write Tests
  • Publish plugin to npm
  • Give the optional flag to rewrite the json file content

About

Insomnia json file template tag which changes content of json file if keywords match with environment variables

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published