Coder Social home page Coder Social logo

ask's People

Contributors

acathur avatar akunchen avatar cj81499 avatar jozsefsallai avatar tricked-dev avatar vicky-gonsalves avatar zhangyuannie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ask's Issues

Add marks

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"
  },
]);

Other number notations

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.

Coding style

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.

No way to ask in a synchronous function

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.

[Bug] prefix of "" is ignored

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?

A way to handle invalid input

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.

Encoding issue on Windows

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.

New features

When will the following examples be supported?

  • list
  • rawlist
  • expand
  • checkbox
  • password
  • editor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.