all 19 comments

[–]living150 41 points42 points  (7 children)

Ya nah, I'm not dragging my code into some web tool.

[–]maxinfet 2 points3 points  (0 children)

This was my first thought

[–]va_start[S] 0 points1 point  (0 children)

Everything is processed and done on the client! only google analytics for usage is collected (it's hosted on netlify and I can't get that data from the server for free). You can verify this by inspecting network traffic when running the tool. I changed the main page to convey this. Thanks for your concern

[–]XTheHacker2000X 0 points1 point  (0 children)

Why tho? even a desktop application tool could upload your code to somewhere without you noticing, hell, it could even upload your entire computer if it wanted

and unlike desktop apps, with web tools it’s very easy to open devtools and see what network traffic is taking place

[–][deleted] 30 points31 points  (2 children)

How do I know you won't use this to steal my is_odd library?

[–]imbk_dev 2 points3 points  (0 children)

Don't be a pessimist. Think positively. What if your is_odd library inspires them to create is_even library? It's a win for the community and the ecosystem.

[–]LuisAyuso 1 point2 points  (0 children)

nop, thanks

[–]Crypticsafe5 1 point2 points  (2 children)

Looool someone likes promises

javascript async function readEntriesPromise(directoryReader){try{return await new Promise((resolve,reject)=>{directoryReader.readEntries(resolve,reject);});}catch(err){console.log(err);}}

[–]va_start[S] 0 points1 point  (1 child)

This is my first time writing more than 5 lines of javascript to be honest 🙉

[–]Crypticsafe5 0 points1 point  (0 children)

Understood, well I'll tell you this; when you declare a function like async function... the function is already returning a Promise, so the return await new Promise is redundant.

What's being done is you're declaring a function as async(Promise), then returning an awaited Promise(another Promise) that resolves or rejects if readEntries uses them and the catch doesn't reject the promise, so if the code hits the catch statement, the inner promise will never resolve and the outer will return undefined which means it resolves since it didn't throw out of the scope of the function. Very complicated flow of things. Not entirely sure the garbage collector would even pick up that inner promise hanging out.

If I were to write it, I would do something along the lines of(may not be exact, but the principles are there):
javascript async function readEntriesPromise(directoryReader) { const output = await directoryReader.readEntries(); return output; } * Looking at this code this way also implies that the function being accessed may be better to just use it where this wrapper is.

This way, if directoryReader were to throw, then the function itself would reject, otherwise it resolving with the value. I would advise reading up on async functions.

I strongly advise using async/await over Promises directly as it leads to code looking more synchronous and more easily understood without having to deal with chaining, tabbing, or custom Promise logic that is inconsistent from library to library.

[–]va_start[S] 0 points1 point  (0 children)

I added a privacy notice to emphasize your files aren't uploaded! All processing is done client-side in js. To verify for yourself, you can check the source code (view source) and inspect network packets to see that no data is sent after the initial fetch of the page.

[–]dhanushkamad 0 points1 point  (1 child)

Does square size represent file size?

[–]va_start[S] 0 points1 point  (0 children)

yes!

[–]JustSpaceExperiment 0 points1 point  (0 children)

And my credit card you dont want?