dark-firepit-modpack/config/openloader/resources/firepit/assets/firepit/tips/tojson.js

21 lines
373 B
JavaScript
Raw Normal View History

2022-09-13 08:26:14 +02:00
const fs = require('fs');
const f = fs.readFileSync('quotes.txt', 'utf8');
f
.split('%')
.map(s => s.trim())
.map(q => ({
"title": {
"text": "Random #evidence quote",
2022-09-13 08:34:25 +02:00
"underlined": true,
2022-09-13 08:26:14 +02:00
"color": "gold"
},
"tip": {
"text": q
}
}))
.map(json => JSON.stringify(json))
.forEach((content, i) => {
fs.writeFileSync(`quote-${i}.json`, content);
});