I am currently working on a Yeoman generator project and have encountered an issue with adding a separator within a multi-select choice set using enquirer.js.
In my attempt to solve this, I explored the possibility of utilizing the following package: https://www.npmjs.com/package/enquirer-separator
Here is an excerpt from my index.js file for the Yeoman generator:
var Generator = require('yeoman-generator');
const { prompt } = require('enquirer');
var Separator = require('enquirer-separator');
module.exports = class extends Generator {
async prompting() {
this.answers = await prompt([
{
type: 'multiselect',
name: 'sizes',
message: 'Sizes:',
choices: [
'160x600',
'728x90',
new Separator('- - - Uncommon - - -'),
'180x150',
'600x500'
]
}
]);
}
}
When running the generator, I anticipated the following output:
Sizes:
- 160x600
- 728x90
- - - Uncommon - - -
- 180x150
- 600x500
However, the actual output generated was as follows:
Sizes:
- 160x600
- 728x90
-
- 180x150
- 600x500
If you have any insights or suggestions on how I can achieve the expected prompt behavior, your input would be greatly appreciated!