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

Use template engine library instead of String.replace #11

Open
2 tasks
20chan opened this issue Sep 25, 2020 · 0 comments
Open
2 tasks

Use template engine library instead of String.replace #11

20chan opened this issue Sep 25, 2020 · 0 comments
Labels

Comments

@20chan
Copy link
Owner

20chan commented Sep 25, 2020

const content = template
.replace("{CURRENT_PLAYING_SOURCE}", info.src)
.replace("{CURRENT_PLAYING_NAME}", info.name)
.replace("{CURRENT_PLAYING_ARTISTS}", info.artists)
.replace("{CURRENT_PLAYING_ALBUM}", info.album)
.replace("{CURRENT_PLAYING_RELEASED}", info.year)
.replace("{CURRENT_PLAYING_ALBUM_SRC}", info.albumCoverImage)
.replace("{CURRENT_PLAYING_URL}", info.url)
.replace("{CURRENT_PLAYING_LAST_UPDATED}", format(info.updatedAt, 'MM/DD/YYYY HH:mm'));

  • Use lightweight template engine.
  • Supports custom date formatting.
@20chan 20chan added the hacktoberfest :tada: label Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant