A simple craft reader for the game Kerbal Space Program
const kspCraftReader = require('ksp-craft-reader');
kspCraftReader.readCraftFromFile('testing.craft').then((craft) => {
console.log(craft.ship);
console.log(craft.version);
console.log(craft.description);
console.log(craft.type);
console.log(craft.size);
}).catch((error) => {
console.error('Error occured while reading file: ', error);
});
const kspCraftReader = require('ksp-craft-reader');
const fs = require('fs-extra');
(async () => {
kspCraftReader.readCraft(await fs.readFile('C:/Users/hp/Downloads/STS-7 Space Shuttle.craft', 'utf8')).then((craft) => {
console.log(craft.ship);
console.log(craft.version);
console.log(craft.description);
console.log(craft.type);
console.log(craft.size);
}).catch((error) => {
console.error(error);
})
})();
Idea from G9 Aerospace, his Discord, his GitHub, and his YouTube