Create a sloppy packLoader that might not even work
This will be useful for future version formats to parse them into a common format.
This commit is contained in:
parent
378076ed9d
commit
5b7964303a
1 changed files with 11 additions and 0 deletions
11
src/packLoader.js
Normal file
11
src/packLoader.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { readFile } from "node:fs/promises";
|
||||
|
||||
function packLoader(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
readFile(file, { encoding: "utf8" }).then(contents => {
|
||||
resolve(JSON.parse(contents));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default packLoader;
|
Loading…
Reference in a new issue