Skip to content

Instantly share code, notes, and snippets.

@EmmanuelDemey
Last active March 17, 2025 13:48
Show Gist options
  • Save EmmanuelDemey/dc880602e285ec70eb36657a7dc6a669 to your computer and use it in GitHub Desktop.
Save EmmanuelDemey/dc880602e285ec70eb36657a7dc6a669 to your computer and use it in GitHub Desktop.
{
"name1": "file1"
}
import { glob, readFile } from "node:fs/promises";
import { resolve } from "node:path";
/**
* * watch
* API Native à base de promises
* Env
* Glob - ExperimentalWarning --disable-warning=ExperimentalWarning NODE_OPTIONS=
* Typescript --experimental-transform-types --no-experimental-strip-types. import type
* Test
*/
const folder = resolve(import.meta.dirname, "content");
readFile(resolve(folder, "file1.json"), (err, content) => {
readFile(resolve(folder, "file2.json"), (err, content2) => {
readFile(resolve(folder, "file3.json"), (err, content3) => {
const output = {
...JSON.parse(content.toString()),
...JSON.parse(content2.toString()),
...JSON.parse(content3.toString()),
};
console.log(output);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment