Skip to content

Use template engine library instead of String.replace #11

@20chan

Description

@20chan

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions