mirror of
https://github.com/RoboSats/robosats.git
synced 2024-09-11 14:05:51 +03:00
19 lines
527 B
JavaScript
19 lines
527 B
JavaScript
|
const fs = require('fs');
|
||
|
const yaml = require('js-yaml');
|
||
|
|
||
|
const fileName = 'navigation_{your languageD}';
|
||
|
|
||
|
// Read YAML file
|
||
|
const yamlData = fs.readFileSync(`./docs/_data/${fileName}.yml`, 'utf8');
|
||
|
|
||
|
// Parse YAML to JavaScript object
|
||
|
const jsonData = yaml.load(yamlData);
|
||
|
|
||
|
// Convert JavaScript object to JSON
|
||
|
const jsonContent = JSON.stringify(jsonData, null, 2);
|
||
|
|
||
|
// Write JSON to file
|
||
|
fs.writeFileSync(`./docs/header-menu-jsons/${fileName}.json`, jsonContent, 'utf8');
|
||
|
|
||
|
console.log('Conversion completed successfully!');
|