0.2.5 • Published 3 years ago

ksp-sfs-to-json v0.2.5

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

sfs-to-json

Contributors Forks Stargazers Issues MIT License

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. 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

...

0.2.5

3 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago