Skip to content
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

Allow to initialize $ #600

Closed
gajus opened this issue Mar 22, 2023 · 2 comments · Fixed by #733
Closed

Allow to initialize $ #600

gajus opened this issue Mar 22, 2023 · 2 comments · Fixed by #733

Comments

@gajus
Copy link

gajus commented Mar 22, 2023

The current API feels awkward, whereby settings are applied after the command, i.e.

$`date`
  .nothrow()
  .quiet();

I'd like to be able to do something like

const $ = createZx({
  nothrow: true,
  queit: true,
});

$`date`
@antongolub
Copy link
Contributor

antongolub commented Mar 22, 2023

I believe v8 will bring smth similar. Here's a proposal:

@antonmedv
Copy link
Collaborator

Yes, I'd like to refactor the api to allow more easy customizations.

$({nothrow: true})`cmd`

@antongolub antongolub mentioned this issue Mar 12, 2024
3 tasks
antongolub added a commit to antongolub/zx that referenced this issue Mar 13, 2024
antongolub added a commit to antongolub/zx that referenced this issue Mar 13, 2024
antonmedv pushed a commit that referenced this issue Mar 17, 2024
* chore: inject zurk

* chore: handle timeouts via zurk

* chore: override zurk quote

* chore: use zurk response to build ProcessOutput

* chore: linting

* chore: use buildCmd from zurk

* feat: provide preset api

closes #600

* docs: add some comments

* build: move zurk to vendor bundle

* chore: move zurk to dev deps

* feat: process quiet as preset option

* refactor: use zurk/spawn

* chore: linting

* build: update esbuild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants