Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const { Scale } = require('enquirer');
const prompt = new Scale({
name: 'experience',
message: 'Please rate your experience',
linebreak: true,
scale: [
{ name: '1', message: 'Strongly Disagree' },
{ name: '2', message: 'Disagree' },
{ name: '3', message: 'Neutral' },
{ name: '4', message: 'Agree' },
{ name: '5', message: 'Strongly Agree' }
],
choices: [
{
name: 'interface',
message: 'A. The website has a friendly interface.',
initial: 2
},
'use strict';
const { Scale } = require('enquirer');
const prompt = new Scale({
name: 'experience',
message: 'Please rate your experience',
number(n) {
let choice = prompt.focused;
let i = +n - 1;
if (i >= prompt.scale.length) return prompt.alert();
choice.scaleIndex = i;
return prompt.render();
},
scale: [
{ name: '1', message: 'Strongly Disagree' },
{ name: '2', message: 'Disagree' },
{ name: '3', message: 'Neutral' },
{ name: '4', message: 'Agree' },
{ name: '5', message: 'Strongly Agree' }
],
'use strict';
const colors = require('ansi-colors');
const { Scale } = require('enquirer');
const prompt = new Scale({
name: 'experience',
message: 'Please rate your experience',
scale: 5,
symbols: { line: ' ' },
edgeLength: 1,
styles: {
primary: colors.blue
},
format() {
return '';
},
renderScaleHeading() {
return '';
},
scaleIndicator(choice, item, i) {
let enabled = choice.scaleIndex >= item.index;
'use strict';
const colors = require('ansi-colors');
const { Scale } = require('enquirer');
const prompt = new Scale({
name: 'experience',
message: 'Please rate your experience',
messageWidth: 30,
margin: ' ',
edgeLength: 3,
margin: [1, 1, 1, 0],
styles: { primary: colors.blue },
scale: [
{ name: '1', message: 'Strongly Disagree' },
{ name: '2', message: 'Disagree' },
{ name: '3', message: 'Neutral' },
{ name: '4', message: 'Agree' },
{ name: '5', message: 'Strongly Agree' }
],
choices: [
{
'use strict';
const { Scale } = require('enquirer');
const prompt = new Scale({
name: 'experience',
message: 'How would you rate your experience?',
hint: '(0=bad, 10=awesome)',
scale: 11,
edgeLength: 2,
choices: [
{
name: 'none',
message: 'The website has a friendly interface.',
initial: 5
},
{
name: 'navigation',
message: 'The website is easy to navigate.',
initial: 5
},
'use strict';
const { Scale } = require('enquirer');
const prompt = new Scale({
name: 'experience',
message: 'Please rate your experience',
scale: [
{ name: '1', message: 'Strongly Disagree' },
{ name: '2', message: 'Disagree' },
{ name: '3', message: 'Neutral' },
{ name: '4', message: 'Agree' },
{ name: '5', message: 'Strongly Agree' }
],
symbols: { line: ' ' },
edgeLength: 1,
messageWidth: 48,
scaleIndicator(choice, item, i) {
let enabled = choice.scaleIndex === item.index;
if (enabled) return this.styles.success(this.symbols.check);
if (this.index === i) return this.styles.muted(this.symbols.check);
'use strict';
const { Scale } = require('enquirer');
const prompt = new Scale({
name: 'experience',
message: 'Please rate your experience',
scale: [
{ name: '1', message: 'Strongly Disagree' },
{ name: '2', message: 'Disagree' },
{ name: '3', message: 'Neutral' },
{ name: '4', message: 'Agree' },
{ name: '5', message: 'Strongly Agree' }
],
margin: [0, 0, 2, 1],
choices: [
{
name: 'interface',
message: 'The website has a friendly interface.',
initial: 2
},