title: How do I manipulate a json file from a script run on a jelastic jps manifest?
body: <p>I have a JSON file available at some URL. In my Jelastic manifest, I want to read it, modify its content, and output that modified content to a json on the environment I am installing / updating:</p>
  
  <pre><code>jpsVersion: 1.3
  jpsType: update
  application:
    id: json
    name: JSON Test
    version: 0.0
  
    onInstall:
    - script: |
        const Transport = com.hivext.api.core.utils.Transport
        const body = new Transport().get('url-to-my-jsonfile.json')
        // 1. here I want to edit the json data, maybe change some values
        // 2. here I want to store the json data in a json file
  </code></pre>
  
  <p>In the above manifest, I first download the json file from some remote endpoint (most probably a raw file from some git repository). Then, I want to load the json into a javascript object, in order to manipulate that object. For example, I'd like to change the value of one of its keys. Finally, I want to output the modified json object somewhere in my environment, e.g. in the <code>/data/my-output.json</code> file. </p>
  
  <p>How do I do that? I tried some stuff, but nothing seems to be working. For example, it seems like <code>JSON.parse</code> is not available in such scripts. What options do I have?</p>
  
  <h2>EDIT</h2>
  
  <p>Currently, what I am doing is that I use a python script that I wrote to manipulate those data. I am wondering if there is something easier with the Jelastic API or available from the javascript scripts.</p>