An open API service indexing awesome lists of open source software.

https://github.com/mmrlapp/modfs

ModFS is a json format processor and also used in MMRL as the ModFS system. See it in action at mmrl.dergoogler.com
https://github.com/mmrlapp/modfs

javascript json library mmrl npm typescript

Last synced: 10 months ago
JSON representation

ModFS is a json format processor and also used in MMRL as the ModFS system. See it in action at mmrl.dergoogler.com

Awesome Lists containing this project

README

          

# ModFS

**Supports**

`array`, `array.length`, `string`, `number`, `boolean`, custom arrays separator with ``, custom array element start and end with ``

Functions now supported ``

Usage

```ts
import ModFS from "modfs";
const fs = new ModFS({
ADB: "/data/adb",
MODULES: "/modules",
NESTED: {
NAME: "Kevin",
PATH: "/user/",
},
CALL: () => {
return "Nice";
},
});

const text = ModFS.format(
"The family of goes averagely over years and the fun fact is that the last name of the family is . Currently the family has a member count of . The names of family are .",
{
human: {
firstName: "Kevin",
lastName: undefined,
},
avgAge: 100,
familyMembers: ["Granpa", "Papa", "Mama"],
}
);

const zips = ["https://google.com", "https://google.com"];

const urls = ModFS.format('mmrl install local ', {
ZIPFILES: zips,
});

console.log("arrays:", urls);

console.log("ModFS.format:", text);

console.log("get:", fs.get("MODULES"));

console.log("get (nested):", fs.get("NESTED"));
console.log("get (nested.PATH):", fs.get("NESTED.PATH")); // returns "/data/adb/user/Kevin"
console.log("get (nested.NAME):", fs.get("NESTED.NAME")); // returns "Kevin"

console.log("get (function):", fs.get("CALL"));

console.log("formatEntries:", fs.formatEntries());

console.log("entries:", fs.entries);

console.log("stringify:", fs.stringify(null, 4));

console.log("stringifyEntries:", fs.stringifyEntries(null, 4));

const result = ModFS.format("Module ", {
valdilate: (root, mod) => {
if (root.toLowerCase() === "magisk") {
return mod;
} else {
return ""
}
},
});

console.log(result);
```