Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-config-airbnb-base eslint-plugin-node eslint-config-node
Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-config-airbnb-base eslint-plugin-node eslint-config-node
| import fs from 'fs'; | |
| import path from 'path'; | |
| const convert = (imgPath) => { | |
| // read image file | |
| fs.readFile(imgPath, (err, data)=>{ | |
| // error handle | |
| if(err) { | |
| throw err; | |
| } |