ksp-sfs-to-json
v0.2.5
Published
Parse Kerbal Space Program SFS file format to JSON.
Downloads
13
Readme
sfs-to-json
Table of Contents
About The Project
This package is used for parsing KSP save files and craft files into JSON.
Getting Started
Import the package using
const { parse } = require("ksp-sfs-to-json")
or
import { parse } from "ksp-sfs-to-json"
Then simply pass it the raw text from the save file.
const toParse = `KERBAL
{
name = Richbart Kerman
trait = Scientist
}`
const parsed = parse(toParse)
console.log(parsed)
output:
{
"KERBAL": {
"name": "Richbart Kerman",
"trait": "Scientist"
}
}
Take a look at the examples folder for better examples.
Prerequisites
- npm or Yarn
npm install npm@latest -g
Installation
Run yarn add ksp-sfs-to-json
or npm install ksp-sfs-to-json
to install this package.
Usage
Test using yarn example2
, for production use-cases, a pre-generated parser (sfs.js) can be built using:
node_modules/pegjs/bin/pegjs sfs.pegjs
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Project Link: hhttps://github.com/eric-johnson-space-administration/sfs-to-json
Acknowledgements
...