{"id":13799471,"url":"https://github.com/maghis/fluent-ssml","last_synced_at":"2025-05-13T08:31:18.833Z","repository":{"id":57238992,"uuid":"100208109","full_name":"maghis/fluent-ssml","owner":"maghis","description":"Alexa SSML templates","archived":false,"fork":false,"pushed_at":"2018-10-18T13:51:32.000Z","size":118,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-09T07:12:39.326Z","etag":null,"topics":["alexa","aws","nodejs","skills","speech","ssml","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maghis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-13T22:23:08.000Z","updated_at":"2020-08-31T00:34:48.000Z","dependencies_parsed_at":"2022-09-05T08:21:35.420Z","dependency_job_id":null,"html_url":"https://github.com/maghis/fluent-ssml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maghis%2Ffluent-ssml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maghis%2Ffluent-ssml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maghis%2Ffluent-ssml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maghis%2Ffluent-ssml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maghis","download_url":"https://codeload.github.com/maghis/fluent-ssml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225190583,"owners_count":17435443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alexa","aws","nodejs","skills","speech","ssml","typescript"],"created_at":"2024-08-04T00:01:03.128Z","updated_at":"2024-11-18T14:30:32.668Z","avatar_url":"https://github.com/maghis.png","language":"TypeScript","funding_links":[],"categories":["NPM Modules"],"sub_categories":[],"readme":"# fluent-ssml\n\nCompose Alexa SSML (*Speech Synthesis Markup Language*) with a fluent interface.\n\nFeatures:\n- support for the full [Alexa SSML Reference](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference)\n- everything is immutable, which makes it reusable and composable (like strings)\n- simple templating\n- extensible and testable\n- typescript types!\n\n**NOTE:** this package is tested on node v8.4.0\n\n## install it\n\n```\nnpm install --save fluent-ssml\n```\n\n## use it\n\nMost basic template\n\n```ts\nimport { ssml, renderXml } from \"fluent-ssml\";\n\nconst template = ssml(\"I am a template\");\n\n// prints \u003cspeak\u003eI am a template\u003c/speak\u003e\nconsole.log(renderXml(template));\n```\n\nUsing templated strings for parametric templates\n\n```ts\nconst template = ssml(p =\u003e `${p.name} is a cool dude`);\n\n// prints \u003cspeak\u003eJon is a cool dude\u003c/speak\u003e\nconsole.log(renderXml(template, { name: \"Jon\" }));\n```\n\nUse the fluent api for more complicated templates\n\nThis code...\n```ts\nconst template = ssml()\n    .p(\n        ssml()\n            .sayAs(\"characters\", \"ssml\")\n            .say(\"templates can get quite complicated\")\n    )\n    .p(\"it's important to keep them composable and parametric\")\n    .p(\n        ssml()\n            .say(\"if you do\")\n            .break({ strength: \"strong\" })\n            .say(p =\u003e `you are gonna keep your ${p.quality}`)\n    )\n    .sayAs(\"interjection\", \"abracadabra\");\n\n// produces a simple object model with the rendered template\n// easy to use for testing or debugging\nconst rendered = template.render({ quality: \"sanity\" });\n\n// produces the final xml\nconst xml = renderXml(rendered);\n\nconsole.log(xml);\n```\n\n...renders this (reformatted for clarity)\n```xml\n\u003cspeak\u003e\n    \u003cp\u003e\n        \u003csay-as interpret-as=\"characters\"\u003essml\u003c/say-as\u003e templates can get quite complicated\n    \u003c/p\u003e\n    \u003cp\u003e\n        it's important to keep them composable and parametric\n    \u003c/p\u003e\n    \u003cp\u003e\n        if you do \u003cbreak strength=\"strong\"/\u003e you are gonna keep your sanity\n    \u003c/p\u003e\n    \u003csay-as interpret-as=\"interjection\"\u003eabracadabra\u003c/say-as\u003e\n\u003c/speak\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaghis%2Ffluent-ssml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaghis%2Ffluent-ssml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaghis%2Ffluent-ssml/lists"}