-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (31 loc) · 832 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
const imageToAscii = require("image-to-ascii");
const loadImage = require("./modules/loadImage.js");
const editImage = require("./modules/editImages.js");
const checkFileExist = require("./modules/checkFileExistence.js")
if(checkFileExist.checkFileExistsSync()){
loadImage.loadFile(image_to_ascii);
}else{
console.log("Saving images to referenced location ...")
editImage.edit();
setTimeout(function(){
[console.log("[\u2713] Saved images"),
(function load() {
console.log("Loading the images ...")
loadImage.loadFile(image_to_ascii);
})()]
}, 4000);
}
function image_to_ascii(image) {
imageToAscii(image, {
colored: false,
pixels: ':|*¨',
size_options: {
screen_size: {
width: 50,
height: 20
}
}
}, (error, converted) =>{
console.log(error || converted);
})
}