Skip to content

dave9123/ksp-craft-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KSP Craft Reader

A simple craft reader for the game Kerbal Space Program

Usage

Read craft from file

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);
});

Read craft directly

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);
    })
})();

Credits

Idea from G9 Aerospace, his Discord, his GitHub, and his YouTube

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published