-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.ts
66 lines (60 loc) · 1.32 KB
/
index.ts
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env node
import meow from 'meow';
import { app } from './app.js';
const cli = meow(
`
Usage:
$ crypto --price <coin name> <additional flags>
Options:
--price, --p - coin name
--price-change, --pc - coin price change (%) in the past 24 hours
--volume, --v - coin volume in the past 24 hours
--high - highest price sold in the past 24 hours
--low - lowest price sold in the past 24 hours
--ath - coin all time high price
--ath-change, --athc - percent price change from ATH
--version - current version of the crypto-cli tool
--save - export all coin data to CSV and/or JSON
Examples:
$crypto --price bitcoin --pc
>> bitoin: $1337 - change (24H): 13.37%
Save coin data:
$crypto --save json
$crypto --save json,csv
`,
{
importMeta: import.meta,
flags: {
price: {
type: 'string',
isMultiple: true,
alias: 'p'
},
priceChange: {
type: 'boolean',
alias: 'pc'
},
volume: {
type: 'boolean',
alias: 'v'
},
high: {
type: 'boolean'
},
low: {
type: 'boolean'
},
ath: {
type: 'boolean'
},
athChange: {
type: 'boolean',
alias: 'athc'
},
save: {
type: 'string'
}
}
}
);
app(cli.input[0], cli.flags);