Skip to content

Commit

Permalink
1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Aug 16, 2024
1 parent 6e31d25 commit b0cd7fc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,34 @@ import ModFS from "modfs";
const fs = new ModFS({
ADB: "/data/adb",
MODULES: "<ADB>/modules",
NESTED: {
NAME: "Kevin",
PATH: "<ADB>/user/<NESTED.NAME>",
},
CALL: () => {
return "Nice";
},
});

const text = ModFS.format("Nice one, <NAME>", {
NAME: "Marvin",
// NAME: undefined -- handle null/undefined values etc
const text = ModFS.format("The family of <human.firstName> goes averagely over <age> years and the fun fact is that the last name of the family is <human.lastName>. Currently the family has a member count of <familyMembers.length>. The names of family are <familyMembers(, )>.", {
human: {
firstName: "Kevin",
lastName: undefined,
},
avgAge: 100,
familyMembers: ["Granpa", "Papa", "Mama"],
});

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);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "modfs",
"version": "1.2.1",
"version": "1.2.2",
"description": "ModFS is a json format processor and also used in MMRL as the ModFS system",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down

0 comments on commit b0cd7fc

Please sign in to comment.