1.1.0 • Published 1 year ago

mcpropertiesparser v1.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
1 year ago

mcPropertiesParser

mcPropertiesParser is a lightweight and typesafe set of utilies to parse and modify .properties file of mc servers

Install

npm install mcpropertiesparser
# or
yarn add mcpropertiesparser

Docs

parsePropertiesFileToJson

NameReturnDescription
parsePropertiesFileToJsonPromiseparsePropertiesFileToJson allow you to get the json conversion of a .properties file

args

ParameterTypeDescriptionRequired
propertiesPathstringpath of the .properties file to parseTrue

example

import {parsedPropertiesFile} from "mcpropertiesparser"
const parsedPropertiesFile = await parsePropertiesFileToJson(path)

propertiesFileHasKey

NameReturnDescription
propertiesFileHasKeyBooleanCheck if a properties file contain a specific key

args

ParameterTypeDescriptionRequired
propertiesFilePropertiesFileproperties file object to checkTrue
keystringkey to check if existTrue

example

import {propertiesFileHasKey} from "mcpropertiesparser"
propertiesFileHasKey(propertiesFile, key)

writePropertiesFile

NameReturnDescription
writePropertiesFilePromiseWrite a properties file object as a .properties file

args

ParameterTypeDescriptionRequired
propertiesPropertiesFileproperties file object to checkTrue
pathstringpath where the file will be writtenTrue

example

import {writePropertiesFile} from "mcpropertiesparser"
// it can be the same path from the actual edited file and will replace the old with the new changes
await writePropertiesFile(properties, path)
1.1.0

1 year ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago