Similar to node-findit but for Dom File System.
npm i domfs-findit
You can use minified findit
bundle with:
<script src="dist/findit.min.js"></script>
When you use webpack just import findit
with:
import findit from `domfs-findit`;
window.addEventListener('drop', (e) => {
e.preventDefault();
const item = e.dataTransfer.items[0];
const entry = item.webkitGetAsEntry();
const finder = findit(entry);
finder.on('file', (file, entry) => {
console.log('file: ', file, entry);
});
finder.on('directory', (file, entry) => {
console.log('directory: ', file, entry);
})
finder.on('end', () => {
console.log('done');
})
});
node.addEventListener('dragover', (e) => {
e.preventDefault();
});
MIT