@bojangles/txt2json

Transform txt file into json

Usage no npm install needed!

<script type="module">
  import bojanglesTxt2json from 'https://cdn.skypack.dev/@bojangles/txt2json';
</script>

README

Transform txt file into json

Format of txt file

// separated with \t & \r
1141269 Ghazni	Ghazni  Asia/Kabul  2018-02-17
2766429 Sankt Pölten  Sankt Poelten Europe/Vienna 2019-09-05
....

How to use it

const input = 'path/to/file.txt';
const output = 'path/where/to/put/file.json';
const porperties = [
  'id',
  'name',
  'asciiname'
  'tz',
  'lastModified',
]

txt2json(input, output, porperties);