From 56ac406221f4b541205820894916f8eec9bfb6fb Mon Sep 17 00:00:00 2001 From: Christian Grobmeier Date: Tue, 14 Jun 2022 11:39:23 +0200 Subject: [PATCH] added a note on using prompt-sync with the import syntax --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 2e72e71..ea2704f 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,18 @@ var prompt = require('prompt-sync')(); // var n = prompt('How many more times? '); ``` + +If you prefer the import syntax, prompt-sync can be used like this: + +```js +import create from 'prompt-sync'; +let prompt = create(); +// +// get input from the user. +// +var n = prompt('How many more times? '); +``` + # WITH HISTORY History is an optional extra, to use simply install the history plugin.