add initialize

This commit is contained in:
Pierre-Henri
2024-04-21 11:30:09 +02:00
parent c2b86a44e6
commit 68e4689fe8
4 changed files with 35 additions and 16 deletions
+11
View File
@@ -73,3 +73,14 @@ Contributions to Meta-Hash are welcome! Please read our contributing guidelines
## License
Meta-Hash is released under the [MIT License](LICENSE.md).
Example of usage:
```typescript
const packageEntryPath = (path.dirname(import.meta.resolve("@metazla/meta-hash"))) + "/worker.js";
console.log("Sha Worker Path", packageEntryPath);
if (!config.INDEX_FOLDER_PATH) {
throw new Error("INDEX_FOLDER_PATH not set");
}
this.hashComputer = new HashComputerIndexCache(config.INDEX_FOLDER_PATH, targetHash, packageEntryPath);
```