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

Add stderr support #13

Merged
merged 1 commit into from
Dec 26, 2022
Merged

Add stderr support #13

merged 1 commit into from
Dec 26, 2022

Conversation

Qix-
Copy link
Member

@Qix- Qix- commented Dec 14, 2022

Closes #11.

This adds stderr support via {chalkStderr and templateStderr} imports.

@Qix-
Copy link
Member Author

Qix- commented Dec 15, 2022

The diff is pretty verbose for what was actually performed. Most of the "changes" are just line indentation.

readme.md Outdated
For printing to standard error (stderr):

```js
import {chalkStderr} from 'chalk-template';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, this should be chalkTemplateStderr.

index.d.ts Outdated
@@ -21,6 +21,7 @@ log(chalk.red.bgBlack(chalkTemplate`2 + 3 = {bold ${2 + 3}}`));
```
*/
export default function chalkTemplate(text: TemplateStringsArray, ...placeholders: unknown[]): string;
export function chalkStderr(text: TemplateStringsArray, ...placeholders: unknown[]): string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a separate doc comment with the stderr example. Same with templateStderr.

@Qix-
Copy link
Member Author

Qix- commented Dec 26, 2022

Should be fixed now.

@sindresorhus sindresorhus merged commit fc9ac0c into main Dec 26, 2022
@sindresorhus sindresorhus deleted the stderr branch December 26, 2022 12:00
midzelis pushed a commit to midzelis/chalk-template that referenced this pull request Jun 13, 2023
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 this pull request may close these issues.

No proper way of templating for stderr
2 participants