Not sold on that. Why should I choose it over Python, PHP or others?
Not sold on that. Why should I choose it over Python, PHP or others?
scripts are supposed to be small simple programs that run in sequence and terminate. I shouldn't need to deal with concurrency primitives at all in that particular situation.
I suppose bash pipes are a concurrency primitive, but I don't object to them. I think it's more about appropriate primitives.
Use whatever you're proficient in. For A LOT of devs that means js.
Why spendtime pulling python into my js project?
Js definitely has become a pleasant language to script in. And it's sooooo much faster that python and Ruby.
That advantage becomes vanishingly small when the language task is to glue together a bunch of spawn/fork/exec to external processes.
If the glue code somehow needs actual heavy processing, that processing can be factored out into another program dedicated to that, leaving only glue code. Side effect: the heavy processing code immediately becomes composable!
typeof '' == 'string'
false
And many others that I'm are too depressing to mention. This is the latest one that I got surprised with.Yes, it's fast but so is Lua, Dart or even Racket.
Seriously. Just don't use ==. Use ===. Et voila you're using a modern pleasant scripting language.
Modern guides on js won't ever mention ==. As a noob today you won't ever learn it. In a big project there will be a linter to stop you
Welcome to Node.js v19.9.0.
Type ".help" for more information.
> typeof '' == 'string'
true
???I‘m playing around with dotnet-scripts [1] at the moment (C# shop mainly) and this has the same issue imho. The reason why I looked into it was because we have developers not accustomed to bash etc. I still find it silly and would rather use ruby so…
Do you mean writing the entire script in a single line in a string in a JSON file (package.json)? Of do you mean that string just calling out to a non-inline script? Because the use case for this is very much that latter script - it will often still be started via `npm run`.
LOL dude
made my day