From fb8838d3304de909d1eeb9d30f932fa2c8f560d4 Mon Sep 17 00:00:00 2001 From: Shane Date: Sat, 20 Dec 2025 09:04:12 +0800 Subject: [PATCH] docs: correct ESM import paths for Node.js compatibility --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c991f9cbd..46af4aeb4 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,12 @@ import validator from 'validator'; Or, import only a subset of the library: ```javascript +// For Bundlers (Webpack, Vite, etc.) import isEmail from 'validator/lib/isEmail'; + +// For Native Node.js ESM +// Note: Use /lib instead of /es/lib, and include the .js extension +import isEmail from 'validator/lib/isEmail.js'; ``` #### Tree-shakeable ES imports