mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-27 03:35:50 +03:00
17 lines
635 B
JavaScript
17 lines
635 B
JavaScript
import fs from 'fs';
|
|
|
|
fetch('https://lingva.phanpy.social/api/v1/languages/source')
|
|
.then((response) => response.json())
|
|
.then((json) => {
|
|
const file = './src/data/lingva-source-languages.json';
|
|
console.log(`Writing ${file}...`);
|
|
fs.writeFileSync(file, JSON.stringify(json.languages, null, '\t'), 'utf8');
|
|
});
|
|
|
|
fetch('https://lingva.phanpy.social/api/v1/languages/target')
|
|
.then((response) => response.json())
|
|
.then((json) => {
|
|
const file = './src/data/lingva-target-languages.json';
|
|
console.log(`Writing ${file}...`);
|
|
fs.writeFileSync(file, JSON.stringify(json.languages, null, '\t'), 'utf8');
|
|
});
|