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
- Host: GitHub
- URL: https://github.com/MMRLApp/ModFS
- Owner: MMRLApp
- License: mit
- Created: 2024-07-03T18:20:30.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-18T15:24:11.000Z (almost 2 years ago)
- Last Synced: 2025-09-03T14:50:17.575Z (10 months ago)
- Topics: javascript, json, library, mmrl, npm, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/modfs
- Size: 11.7 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```