1.0.0 • Published 11 months ago
bfme-csf-str v1.0.0
Bfme-csf-str
Use this library for convert The Battle For Middle-Earth language file
- .csf -> .str
 - .csf -> .json
 - .str -> .csf
 - .json -> .csf
 
npm install bfme-csf-strExamples
Convert from .str to .csf
import { Csf } from "bfme-csf-str"; // or const { Csf } = require("bfme-csf-str")
async function strToCsf() {
   const bufferData = await Csf.readFromStr("lotr.str");
   await Csf.writeFile("lotr.csf", bufferData);
}
strToCsf();Convert from .json to .csf
import { Csf } from "bfme-csf-str"; // or const { Csf } = require("bfme-csf-str")
async function jsonToCsf() {
   const bufferData = await Csf.readFromJson("lotr.json");
   await Csf.writeFile("lotr.csf", bufferData);
}
jsonToCsf();Convert from .csf to .str
import { Csf } from "bfme-csf-str"; // or const { Csf } = require("bfme-csf-str")
async function csfToStr() {
   const strData = await Csf.readFile("lotr.csf");
   await Csf.saveAsStr("lotr.str", strData);
}
csfToStr();Convert from .csf to .json
import { Csf } from "bfme-csf-str"; // or const { Csf } = require("bfme-csf-str")
async function csfToJson() {
   const jsonData = await Csf.readFile("lotr.csf");
   await Csf.saveAsJson("lotr.json", jsonData);
}
csfToJson();1.0.0
11 months ago