-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request] Support looping over simple lists #78
Comments
A big criticism of Due to that, it might be difficult to get this one in. Right now if people need loops the recommened thing to do would be to create a JavaScript file that does this and call it from a deno task via |
That's fair 👍 FWIW, Deno has a reputation for not needing a bunch of scripts and configs. I think that's a little at odds though with this feature. Right now the ability to write practical Deno one-liners is pretty limited without more robust task support like looping. I do think this opens a can of worms though for a vein of work the Deno team might not want to focus on. However, between no longer having a deno_task_shell is brilliant(!) and I'm not suggesting I want to use shell in Deno but idiomatic NPM scripts assume shell and that gives a lot of succinct flexibility that Deno tasks doesn't have right now. |
@niedzielski For comparison, here's what it looks like to implement your example loop using Deno's // deno.jsonc
{
"tasks": {
"loop": "deno eval 'for (const i of \"abc\") console.log(1, i, 2);'"
}
}
|
Historically, looping has been pretty handy. Simple support is wanted to avoid lengthier JavaScripts:
The intended use case is simple lists and differs from
xargs
which is useful for mapping stdin to a command.References
The text was updated successfully, but these errors were encountered: