flatiron / prompt

a beautiful command-line prompt for node.js

Home Page:http://github.com/flatiron/prompt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: giving default a function returns the stringified version of the function

3stacks opened this issue · comments

prompt.get([
  {
    name: 'themeName'
  },
  {
    name: 'themeSlug',
    default: function() {
      return 'foo';
    },
    pattern: /^[a-z]+(-[a-z]+)*$/gm
  }
], (err, result) => {...})

The default value of the themeSlug prompt is function() { return 'foo'; } as a string.

EDIT: I just installed the package by pointing to the git repo and it's working correctly.

Was this feature not added as of ^1.0.0 which I am currently on? (installed from npm without explicitly adding version)

Thank you for reporting this issue as it saved me time.

Yes and confirmed, do not use npm version if default function needed.

npm install github:flatiron/prompt

@AckerApple why isn't npm package up to date?

Closing this issue because it most likely won't be addressed! I've switched to enquirer (https://www.npmjs.com/package/enquirer)