From f71983a2579968f22aeb5d6180390f7f914876bc Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Wed, 21 Oct 2020 16:52:54 -0230 Subject: [PATCH] Fix usage instructions in README Refs #79 This change updates the usage instructions in the README to explain the workaround required to use this module. As userland modules do not hide core modules, a trailing slash is required to have Node.js use this module over the built-in. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee2f9d6..36259bb 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,12 @@ npm install punycode --save In [Node.js](https://nodejs.org/): +> ⚠️ Note that userland modules don't hide core modules. +> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`. +> Use `require('punycode/')` to import userland modules rather than core modules. + ```js -const punycode = require('punycode'); +const punycode = require('punycode/'); ``` ## API