<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[JsonBank.IO Blog]]></title><description><![CDATA[JsonBank.IO Blog]]></description><link>https://blog.jsonbank.io</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 07:49:34 GMT</lastBuildDate><atom:link href="https://blog.jsonbank.io/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[JSON to Env]]></title><description><![CDATA[A Backend programmer who has lost their device in the past will understand the stress it takes to re-create the development env files for your projects. 😢
Apart from sad scenarios like this,  there is always no sync in changes that happen with env f...]]></description><link>https://blog.jsonbank.io/json-to-env</link><guid isPermaLink="true">https://blog.jsonbank.io/json-to-env</guid><category><![CDATA[jsonbank]]></category><dc:creator><![CDATA[jsonbank]]></dc:creator><pubDate>Sat, 29 Oct 2022 21:18:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1667076120697/6qL4hMeVa.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A Backend programmer who has lost their device in the past will understand the stress it takes to re-create the development env files for your projects. 😢</p>
<p>Apart from sad scenarios like this,  there is always <strong>no sync</strong> in changes that happen with env files amongst <strong>teams</strong>. In some cases, you will probably run the program first or check an env declaration file if it exists for guidelines on how to create your env file. These guidelines do not include the env <strong>values</strong> or <strong>API keys</strong> 🤯</p>
<p>These situations can be prevented by using the <a target="_blank" href="https://www.npmjs.com/package/jsonbank-env"><code>jsonbank-env</code></a> cli package.</p>
<h5 id="heading-requirements">Requirements</h5>
<ul>
<li>Nodejs Installed.</li>
<li>Jsonbank account</li>
<li>Jsonbank <code>public key</code>.</li>
</ul>
<h3 id="heading-getting-started">Getting Started.</h3>
<p>Create a new <strong>private</strong> project on jsonbank or use any existing <strong>private</strong> project.
For this post, we will be using a new project we created called <strong><code>envs</code></strong></p>
<p>We will also create 3 new files </p>
<ul>
<li>default.json</li>
<li>default-array.json</li>
<li>prod.json</li>
</ul>
<p>default.json</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"NODE_ENV"</span>: <span class="hljs-string">"development"</span>,
  <span class="hljs-attr">"PORT"</span>: <span class="hljs-number">3000</span>,
  <span class="hljs-attr">"SSL"</span>: <span class="hljs-literal">null</span>,
  <span class="hljs-attr">"DB_HOST"</span>: <span class="hljs-string">"localhost"</span>,
  <span class="hljs-attr">"DB_USER"</span>: <span class="hljs-string">"root"</span>,
  <span class="hljs-attr">"DB_PASS"</span>: <span class="hljs-string">"root"</span>,
  <span class="hljs-attr">"DB_NAME"</span>: <span class="hljs-string">"test"</span>
}
</code></pre>
<p>default-array.json</p>
<pre><code class="lang-json">[
  {
    <span class="hljs-attr">"NODE_ENV"</span>: <span class="hljs-string">"development"</span>,
    <span class="hljs-attr">"PORT"</span>: <span class="hljs-number">3000</span>
  },
  {
    <span class="hljs-attr">"SSL"</span>: <span class="hljs-literal">null</span>
  },
  {
    <span class="hljs-attr">"DB_HOST"</span>: <span class="hljs-string">"localhost"</span>,
    <span class="hljs-attr">"DB_USER"</span>: <span class="hljs-string">"root"</span>,
    <span class="hljs-attr">"DB_PASS"</span>: <span class="hljs-string">"root"</span>,
    <span class="hljs-attr">"DB_NAME"</span>: <span class="hljs-string">"test"</span>
  }
]
</code></pre>
<p>prod.json</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"NODE_ENV"</span>: <span class="hljs-string">"production"</span>,
  <span class="hljs-attr">"PORT"</span>: <span class="hljs-number">80</span>,
  <span class="hljs-attr">"SSL"</span>: <span class="hljs-literal">true</span>,
  <span class="hljs-attr">"DB_HOST"</span>: <span class="hljs-string">"localhost"</span>,
  <span class="hljs-attr">"DB_USER"</span>: <span class="hljs-string">"root"</span>,
  <span class="hljs-attr">"DB_PASS"</span>: <span class="hljs-string">"root"</span>,
  <span class="hljs-attr">"DB_NAME"</span>: <span class="hljs-string">"test"</span>
}
</code></pre>
<p>So your project menu should be looking like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667076829538/YsXmQO8o0.png" alt="Screenshot 2022-10-29 at 9.50.24 PM.png" /></p>
<h3 id="heading-generate-config-file">Generate Config File</h3>
<p>Navigate to your local working directory where you want the envs to be imported.</p>
<p>Run </p>
<pre><code class="lang-sh">npx jsonbank-env init
</code></pre>
<p>This will create your <code>jsonbank.env.json</code> file. This file is where you will set your public key and remote paths to your env files.</p>
<h4 id="heading-get-your-public-key">Get your Public key</h4>
<p>Create a new application on jsonbank and you will be given your <strong><code>public</code></strong> and <strong><code>private</code></strong> keys. Put the public key in your <code>jsonbank.env.json</code></p>
<h4 id="heading-set-your-remote-files">Set your remote files</h4>
<p>Set your config file to look like this</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"public_key"</span>: <span class="hljs-string">"Your public key"</span>,
  <span class="hljs-attr">"envs"</span>: {
      <span class="hljs-attr">"dev"</span>: <span class="hljs-string">"envs/default.json"</span>,
      <span class="hljs-attr">"dev:formatted: "</span>envs/default-array.json<span class="hljs-attr">",
      "</span>prod<span class="hljs-attr">": "</span>envs/prod.json<span class="hljs-attr">"
   }
}</span>
</code></pre>
<h3 id="heading-fetch-env-files">Fetch Env Files</h3>
<p>Get the <code>dev</code> env file and save it as <code>.env</code></p>
<pre><code class="lang-sh">npx jsonbank-env dev .env
</code></pre>
<p>Your generated env file should look like</p>
<pre><code class="lang-env">NODE_ENV="development"
PORT=3000
SSL=
DB_HOST="localhost"
DB_USER="root"
DB_PASS="root"
DB_NAME="test"
</code></pre>
<p>Get the <code>dev:formatted</code> env file and save it as <code>.neat.env</code></p>
<pre><code class="lang-sh">npx jsonbank-env dev:formatted .neat.env
</code></pre>
<p>Your generated env file should look like this with neat spacing because the json content is an <code>array of objects</code>. Each object in the array is automatically separated with a new line.</p>
<pre><code class="lang-env">NODE_ENV="development"
PORT=3000

SSL=

DB_HOST="localhost"
DB_USER="root"
DB_PASS="root"
DB_NAME="test"
</code></pre>
<p>Now try the last one for <code>prod</code> env file. it should generate an env with <code>NODE_ENV=production</code></p>
<p>We hope you find this service as useful as we did.
For more info, see the <a target="_blank" href="https://www.npmjs.com/package/jsonbank-env">npm package documentation</a></p>
]]></content:encoded></item><item><title><![CDATA[October 29th Updates]]></title><description><![CDATA[Hurray!! 🚀🚀 This update is packed with new features we implemented over the weekend.
New File Manager

The new Project File Manager gives a table view of your files and folders. This is necessary when files get up to 1000+ in a folder.  🧐
You will...]]></description><link>https://blog.jsonbank.io/october-29th-updates</link><guid isPermaLink="true">https://blog.jsonbank.io/october-29th-updates</guid><category><![CDATA[jsonbank]]></category><dc:creator><![CDATA[jsonbank]]></dc:creator><pubDate>Sat, 29 Oct 2022 20:28:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1667075207868/lL0uWNuse.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hurray!! 🚀🚀 This update is packed with new features we implemented over the weekend.</p>
<h3 id="heading-new-file-manager">New File Manager</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667075226326/8Yb-VwyVx.png" alt="Screenshot 2022-10-29 at 7.46.16 PM.png" /></p>
<p>The new Project File Manager gives a table view of your files and folders. This is necessary when files get up to 1000+ in a folder.  🧐
You will have paginated results of your files and folder 25/25 respectively with a load more button for folders and a numbered pagination for files. 😁</p>
<h3 id="heading-watch-project">Watch Project</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667075243951/yNXyXyNBF.png" alt="Screenshot 2022-10-29 at 7.47.29 PM.png" /></p>
<p>Before now you could only get event alerts on files for <code>file.updated</code> and <code>file.deleted</code> events.</p>
<p>Now, you can watch a project for events that happens in a project via webhooks</p>
<p>The events currently supported are</p>
<ul>
<li><code>file.created</code> =&gt; Fires when a new file is <strong>created</strong>.</li>
<li><code>file.updated</code>=&gt; Fires when any file in the project is <strong>updated</strong>.</li>
<li><code>file.deleted</code> =&gt; Fires when any file in the project is <strong>deleted</strong>.</li>
</ul>
<h3 id="heading-json-to-env">Json to Env</h3>
<p>A node CLI package to load your env variables from the cloud.
See the blog post about it here: <a target="_blank" href="https://blog.jsonbank.io/json-to-env">Load your env from the cloud</a> </p>
]]></content:encoded></item></channel></rss>