UNPKG

geojson2gtfs

Version:

A tiny nodeJs cli app to transform geoJson files (describing an onDemand informal public transport routes) to its corresponding GTFS entities.

15 lines (13 loc) 485 B
const fse = require('fs-extra'); const colorprint = require('colorprint'); exports.initializeEmptyFolder = function(folderPath) { // empties the folder, dont delete the folder itself just the content // if the folder doesn't exists, its created try { fse.emptyDirSync(folderPath); } catch (error) { colorprint.fatal(`Error creating or initialazing folder ${folderPath}`); throw `Error creating initialazing folder ${folderPath}`; } }