-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
37 lines (32 loc) · 772 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'use strict';
const alfy = require('alfy');
const lorem = require('lorem-ipsum');
function generateSentenceOutput(count) {
return {
title: count > 1 ? `${count} Sentences` : 'Sentence',
subtitle: 'Press enter to copy',
arg: lorem({
units: 'sentences',
count,
sentenceLowerBound: 5,
sentenceUpperBound: 15
})
};
}
function generateParagraphOutput(count) {
return {
title: count > 1 ? `${count} Paragraphs` : 'Paragraph',
subtitle: 'Press enter to copy',
arg: lorem({
units: 'paragraphs',
count,
paragraphLowerBound: 5,
paragraphUpperBound: 15
})
};
}
const count = parseInt(alfy.input, 10) || 1;
alfy.output([
generateParagraphOutput(count),
generateSentenceOutput(count)
]);