const search = document.querySelector('#search');
const allLinks = document.querySelectorAll('#container>p>a');
search.onkeyup = function (event) {
const regex = new RegExp(event.target.value.toLowerCase());
allLinks.forEach(element => {
if (regex.test(element.textContent.toLowerCase())) {
element.style.display = '';
} else {
element.style.display = 'none';
}
})
}
window.frames[0].addEventListener('message', receiveMessage, false);
function receiveMessage(event) {
console.log(event.data);
}
window.postMessage('Hello World', 'Your domain');
const { createReadStream } = require('fs');
const { resolve } = require('path');
app.get('/stream', (req, res) => {
const readStream = createReadStream(resolve(__dirname, 'ypurFilePath'));
readStream.on('open', function () {
readStream.pipe(res);
});
readStream.on('error', res.end(err));
res.on('close', readStream.close());
res.on('error', readStream.close());
});