title: Convert sequence of JSON lines (JSONL) to JSON array
body: <p>I have a file where each line is a JSON object. I'd like to convert the file to a JSON array.</p>
  
  <p>The file looks something like this:</p>
  
  <pre><code>{"address":"email1@foo.bar.com", "topic":"Some topic."}
  {"address":"email2@foo.bar.com", "topic":"Another topic."}
  {"address":"email3@foo.bar.com", "topic":"Yet another topic."}
  </code></pre>
  
  <p>I'm using bash and jq.</p>
  
  <p>I tried </p>
  
  <pre><code>jq --slurp --raw-input 'split("\n")[:-1]' my_file
  </code></pre>
  
  <p>But that just treats each line as a string creating a JSON array of strings.</p>
  
  <pre><code>[
    "{\"address\":\"email1@foo.bar.com\", \"topic\":\"Some topic.\"}",
    "{\"address\":\"email2@foo.bar.com\", \"topic\":\"Another topic.\"}",
    "{\"address\":\"email3@foo.bar.com\", \"topic\":\"Yet another topic.\"}"
  ]
  </code></pre>
  
  <p>I'd like to have:</p>
  
  <pre><code>[
    {"address":"email1@foo.bar.com", "topic":"Some topic."},
    {"address":"email2@foo.bar.com", "topic":"Another topic."},
    {"address":"email3@foo.bar.com", "topic":"Yet another topic."}
  ]
  </code></pre>