jozsefsallai / ask Goto Github PK
View Code? Open in Web Editor NEWinteractive command-line prompts for deno
License: MIT License
interactive command-line prompts for deno
License: MIT License
If not I would offer to do so.
Ideally, we should respect NO_COLOR to disable default color output. This can be achived by using the standard library https://deno.land/[email protected]/fmt/colors.ts. inquirer
supports this by using chalk
.
Hi!
How to replace a question mark?
To make the Ask
better, add the ability to change the question mark.
It would be nice to put your own signs or spinners.
Example:
const answers = await ask.prompt([
{
name: "name",
type: "input",
message: "Name:",
mark: "spinner"
},
{
name: "age",
type: "number",
message: "Age:",
mark: "dot"
},
]);
Nice work! As an idea, it would be great to have E notation to do 1e15 instead of 1000000000000000. Maybe other notation to where it makes sense too.
Ideally, we should follow deno's style guide so we can use deno fmt
and deno lint
to enhance the developer experience and encourage contributions.
If the current style is preferred, we should provide a config file or EditorConfig or something similar so developers can leverage other formatter, linter.
It seems you would almost always want to use ask synchronously, rather than asynchronously.
For example, in a object's constructor, you might want to ask for confirmation.
I don't want any prefix, but ask ignores the empty string and uses the default regardless.
I imagine there is a if (prefix)
check that should be if (prefix === undefined)
or something similar?
Is there a way to handle invalid input? By default, it just keeps repeating the question until the input passes the validate
function.
This can be confusing to the user, so instead I'd like the option to output an error message.
Given the following sample program:
import Ask from 'https://deno.land/x/[email protected]/mod.ts';
const ask = new Ask();
const { domain } = await ask.input({
name: 'domain',
message: 'Domän:',
});
console.log(`Domain: ${domain}`);
Running it on Linux, it works as expected:
❯ deno run menu-test.ts
? Domän:
But on Windows, it doesn't show the correct output:
❯ deno run menu-test.ts
? Domän:
It doesn't seem like it's an environment issue, running console.log('Domän');
works as expected on both Windows and Linux.
When will the following examples be supported?
list
rawlist
expand
checkbox
password
editor
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.