From 0883cc0cf031e9b993213e9f338d4f1f6dcdc887 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Mon, 27 May 2024 11:32:29 +0530 Subject: [PATCH] Fix require function name in README.md The variable holding the function returned by `createRequire()` is named `req` but the `require` function is being used below, so `require` is undefined here. This fixes that by ensuring that both variable names are the same. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 826eaab..6293403 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Consider this contrived example: // import the class from ESM import { SomeClass } from 'module-built-by-tshy' import { createRequire } from 'node:module' -const req = createRequire(import.meta.url) +const require = createRequire(import.meta.url) // create an object using the commonjs version function getObject() {