From f831fc83d582174ca3a91e9f65afd845e2250a52 Mon Sep 17 00:00:00 2001 From: Jacob Ley Date: Wed, 4 May 2022 17:44:15 -0400 Subject: [PATCH] Fix dynamic import snippet --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 29c2594..ec2e2c0 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ if (validator(unknownUserInput)) { ## Usage -Juniper is an ESM module. That means it _must_ be `import`ed. To load from a CJS module, use dynamic import `import { stringSchema } = await import('juniper');`. +Juniper is an ESM module. That means it _must_ be `import`ed. To load from a CJS module, use dynamic import `const { stringSchema } = await import('juniper');`. For every schema exported, there is both a class and functional constructor for each schema. The class can be instantiated directly via the `new` keyword, or via the static `create` method. The functional constructor is a reference to the `create` method. All three are perfectly valid ways of creating a schema, and entirely up to you to prefer OOP vs functional programming styles.