-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·28 lines (24 loc) · 779 Bytes
/
index.js
File metadata and controls
executable file
·28 lines (24 loc) · 779 Bytes
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
#!/usr/bin/env node
/*
Favico Generator.. Generates Favicons from Image files by Abdul <laisibizness@gmail.com>
*/
// Lets start the party over here..
const fs = require('fs');
const argv = require('yargs')
.usage('Usage: $0 option filename \n e.g $0 -f image.png -r 160x160')
.alias('f', 'file')
.alias('r', 'res')
.nargs('f', 1)
.nargs('r', 1)
.describe('f', 'Loads file to be converted to favico')
.describe('r', 'Specifies the width and height e.g 160x160')
.demandOption(['f', 'r'])
.help('h')
.alias('h', 'help')
.epilog('Copyright Abdul 2017').argv;
const favico = require('./src/lib');
favico(argv.file, 'favico.ico', argv.res)
.then(() =>
console.log('Success, File saved as favico.ico in ' + process.cwd())
)
.catch(console.error);