2.0.1 • Published 7 years ago

domfs-findit v2.0.1

Weekly downloads
65
License
MIT
Repository
github
Last release
7 years ago

DOM File System Findit

Similar to node-findit but for Dom File System.

Install

npm i domfs-findit

How to use?

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();
});

License

MIT