Shortest File Information Project

I’ve got a challenge: Make the Shortest File Information Project. I made this example:

So the user will put a file(s) inside the files folder. For every file in that folder, it will display the char count, word count, etc.

I will not accept minified JS as an answer. The console.log() line will not be counted in the number of characters, so you can make it as long as you want. I will be using https://www.uglifyjs.net/ to measure the amount of characters, so you don’t need to worry about spaces and indents. Also, I will be also measuring by the number of features and grammar.

Praquron’s - https://replit.com/@Praquron/Challenge-Shortest-File-Information-Project?v=1
lightdefusion’s - https://replit.com/@lightdefusion/SFIP#index.js
Matt’s - https://replit.com/@MattDESTROYER/File-Info?v=1
justcoding’s - https://replit.com/@JustCoding123/shortest-file-info

NOTE - I AM ORDERING THE LINKS BASED ON TIME SENT!

Hmmm, why does this not include things like permissions, but instead has things like word count.

And is the only in js?

2 Likes

This is my attempt at doing this: https://replit.com/@Praquron/Challenge-Shortest-File-Information-Project?v=1

2 Likes

@OmegaOrbitals
In less than 15 lines I did this here.
Slighly messy output, but pretty good in my opinion.

2 Likes

What?? UglifyJS said valid JS only…

Nvm… I will count the console.log() lines. Sorry if this mislead you

Well, I’m sorry, Praquron, but lightdefusion did better. Yours was good, too, but I said

“So the user will put a file(s) inside the files folder. For every file in that folder, it will display the char count, word count, etc.”

Ok, updated it, should be following the rules now

2 Likes

Yes, it’s only in JS. You can have as much features as you want, the screenshot is only a very basic example.

Also, this will end on April 6.

How’s this? It’s technically two lines, although it’s actually across six. Dunno if it can get much shorter… (It’s also not the most readable code…)

3 Likes

Do you think I should decide the winner, or let y’all vote?

2 Likes

Definitely should let the community vote, it’s more fair this way.

3 Likes

I’ll open voting on April 6!

2 Likes

Added a whole bunch more stats to mine for fun :slight_smile:

Stats:

  • File
  • Name
  • Extension
  • Path
  • Size
  • Contents
  • Chars
  • Words
  • Lines
2 Likes

Eh, I think I still did better than you because it’s colorful :).

Is that a challenge? (View updated repl :wink:)

I guess so, I still have less characters than you though…

2 Likes

Only by ~200 chars, and a lot of that’s probably the text that describes the extra features. :man_shrugging:

1 Like

Well, sure the features are nice (and will count to the number of features), they are gimmicks and aren’t really useful in a real-world scenario.

1 Like