Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function readLineMemory() {
- loadFile = dialog.showOpenDialog({properties: ['openFile']})
- const loadPls = loadFile;
- const lr = new LineByLineReader(loadPls[0]);
- lr.on('error', err => {
- return console.log(err);
- });
- lr.on('line', line => {
- const lineParse = JSON.parse(line);
- JSONParsed.push(lineParse);
- const htmlTabled = tableify(lineParse) + '<hr>';
- html = html && tableify(lineParse);
- html = 'data:text/html,' + encodeURIComponent(html);
- win.loadURL(html);
- })
- // fs.appendFile(`${process.resourcesPath}/index2.html`, htmlTabled, err => {
- // if (err) {
- // return console.log(err);
- // }
- // });
- // });
- // fs.appendFile(`${process.resourcesPath}/index2.html`, '<script src="https://use.fontawesome.com/a39359b6f9.js"></script><style>body {padding: 0; margin: 0; } body {background-color: #313943; color: #bbc8d8; font-family: \'Lato\'; font-size: 22px; font-weight: 500; line-height: 36px; margin-bottom: 36px; text-align: center; } header {position: absolute; width: 500px; height: 250px; top: 50%; left: 50%; margin-top: -125px; margin-left: -250px; text-align: center; } header h1 {font-size: 60px; font-weight: 100; margin: 0; padding: 0; } #grad {background: -webkit-linear-gradient(left, #5A3F37 , #2C7744); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(right, #5A3F37 , #2C7744); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(right,#5A3F37 , #2C7744); /* For Firefox 3.6 to 15 */ background: linear-gradient(to right, #5A3F37 , #2C7744); /* Standard syntax */ } hr {color: red; }</style><link href="https://fonts.googleapis.com/css?family=Lato:400,400italic,700" rel="stylesheet" type="text/css">', err => {
- // if (err) {
- // return console.log(err);
- // }
- // });
- lr.on('end', () => {
- console.log('done!');
- console.log('The file was saved!');
- // win.loadURL(`file://${process.resourcesPath}/index2.html`);
- });
- return win;
- }
Advertisement
Add Comment
Please, Sign In to add comment