1. 33
    1. 3

      Very cool! I believe “which” does not work on powershell because it’s not Unix. been using on bash/zsh “where” to list all, and “command -v” in place of “which”.

      1. 3

        I was using the type shell builtin, but I don’t know if it’s in Powershell.

        1. 4

          In PowerShell there’s Get-Command (and the alias gcm), which is the analog of the type builtin on bash/zsh, or where with the -All flag.

          PS C:\Users\diogotito> gcm bun*
          
          CommandType     Name                                               Version    Source
          -----------     ----                                               -------    ------
          Application     bun.exe                                            1.1.0.0    C:\Users\diogotito\AppData\Local\Microsoft\WinGet\Links\bun.exe
          Application     bundle.bat                                         0.0.0.0    C:\Ruby31-x64\bin\bundle.bat
          Application     bundler.bat                                        0.0.0.0    C:\Ruby31-x64\bin\bundler.bat
          Application     bunx.exe                                           1.1.0.0    C:\Users\diogotito\AppData\Local\Microsoft\WinGet\Links\bunx.exe
          

          Now, type does exist in both Command shell and PowerShell (as an alias to Get-Content), but it acts more like cat (which happens to be another alias for Get-Content). Also, where (and ?) in PowerShell is an alias to Where-Object, which is used to select objects from a collection piped into it based on criteria.

          PS> Get-Command type, Get-Content, where, Where-Object | Format-Table -AutoSize
          
          CommandType Name                  Version   Source
          ----------- ----                  -------   ------
          Alias       type -> Get-Content
          Cmdlet      Get-Content           7.0.0.0   Microsoft.PowerShell.Management
          Alias       where -> Where-Object
          Cmdlet      Where-Object          7.4.1.500 Microsoft.PowerShell.Core
          
          1. 1

            Yes, thanks for the correction.

        2. 2

          JavaScript is the world’s most popular scripting language. So, why is running shell scripts so complicated?

          Because JavaScript is not a shell scripting language?

          I’m not sure what is the advantage of having this bundled into the runtime instead of using a library (like Google’s zx).

          1. 3

            Not really sure why bun exists in the first place, tbh. It’s flattening all your tools into one tool, sure, but then you have edge cases where you need to dive into those individual tools to tune behavior anyways, and now you’re locked into yet another tool in your JS stack.

            1. 2

              Bun’s biggest selling point is performance for short lived tasks, not tool consolidation.

              They are trying to support all existing tooling too, not replace them.

            2. 2

              I’ve been using it and I think it’s great. Some things are better done in the shell (external commands, gluing together pipelines) and others are better done in JS (real data structures, using JS libraries). Often they overlap and I need to do both in one script, and Bun’s $ syntax makes it really convenient. I also find doing things concurrently in JS with Promise.all, etc. is much nicer than backgrounding jobs in shell.

            3. 3

              Of note, Windows support is now official.

              1. 1

                Finally! I can try it on my computer!

                I’m not one to follow web trends (I just stick with nextjs and npm) but I’ve been interested to try Bun and see what all the hype (and venture funding) is about

                1. 2

                  You’re likely set in your tools for Node.js but imagine if all those tools just came with Node.js in the first place. In my line of work just having the typescript transpiler built into the runtime is a huge win.

                  1. 3

                    Honestly a compelling argument, but I had hopes for Deno and it seems to be a constant hobby project - a joke I hear is the only production Deno software is the Deno homepage.

                    There’s also jsr.io that popped up recently too. I may experiment a bit with Bun, assuming Next.js works fine with it!

                    1. 4

                      What makes you say that? I’ve got a good handful of Deno projects in production and am a huge fan at the moment. The tooling, Deno std lib, and npm compatibility make the project pretty compelling for me.

                      1. 1

                        Oh it’s just a general vibe, anecdata not fact, I’m not aware of any businesses using Deno in production but I’m sure there are! What sort of products have you built with Deno currently? I’m quite curious how it stacks up against the rest - particularly in hiring/longevity discussions etc. (which is why I typically tend to advise companies I work with to just stick with the most boring and widely used tools)

                        1. 2

                          Ah gotcha! As far as businesses using Deno, Slack is using it for their new automation platform, Netlify and Supabase for their serverless/functions offering, etc. It has some big deployments out there for sure!

                          The main Deno application we have in production is a small service that collects analytics on internal tools’ usage and reports it up to Datadog. It’s nothing big or shiny, but it works wonderfully and the repository is one of the simplest in our collection.

                          And I think your advice is correct, just for the record ;)

                          1. 3

                            The folks at val.town are also using it in production in the current iteration of their runtime.

                            1. 1

                              Oh snap! I didn’t realize val.town was using Deno! I’ll need to take a second look!

                            2. 1

                              Oh nice, that’s much better than I thought, I’m glad Deno is seeing some success in the enterprise world! Thanks 😁

                      2. 2

                        Yeah, never again the bullshit of having to figure out node-ts/ts-node. It should just run.

                    2. 1

                      I’m loving Bun, just sad that it doesn’t work with Nest.

                    🇬🇧 The UK geoblock is lifted, hopefully permanently.