{"_id":"@remix-run/html-template","_rev":"5-fb73a83b92f6b7032de031ce4687a37c","name":"@remix-run/html-template","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.0":{"name":"@remix-run/html-template","version":"0.1.0","keywords":["html","template","tagged-template","template-literal","safe-html","xss","escaping","sanitize","security"],"author":{"name":"Michael Jackson","email":"mjijackson@gmail.com"},"license":"MIT","_id":"@remix-run/html-template@0.1.0","maintainers":[{"name":"mjackson","email":"mjijackson+npm@gmail.com"},{"name":"ryanflorence","email":"rpflorence@gmail.com"}],"homepage":"https://github.com/remix-run/remix/tree/main/packages/html-template#readme","bugs":{"url":"https://github.com/remix-run/remix/issues"},"dist":{"shasum":"fa9901fc38345e42a67949a5424ad8ea18d18532","tarball":"https://registry.npmjs.org/@remix-run/html-template/-/html-template-0.1.0.tgz","fileCount":11,"integrity":"sha512-j/I0apj96jqExEvbXBPFn7kf6ggUpXFpRf7YkaQLTvmPu72NTjo7O0oszV5pareUjccnm25yDXB0uQABzQZRew==","signatures":[{"sig":"MEYCIQDlj3DM6dz3qQQJ9i3sx2P81O7z7wKL0/fF6U6gssNhYQIhAJ9M0CYxA+B7nT9aTz1zlhGungaxe75DmBFxWoegPFkr","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19683},"type":"module","_from":"file:remix-run-html-template-0.1.0.tgz","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"node --disable-warning=ExperimentalWarning --test './src/**/*.test.ts'","build":"pnpm run clean && pnpm run build:types && pnpm run build:esm","clean":"rm -rf dist","build:esm":"esbuild src/index.ts --bundle --outfile=dist/index.js --format=esm --platform=neutral --sourcemap","typecheck":"tsc --noEmit","build:types":"tsc --project tsconfig.build.json"},"_npmUser":{"name":"mjackson","email":"mjijackson+npm@gmail.com"},"_resolved":"/private/var/folders/n5/1lxhnzk56hg6b7vnl558364m0000gn/T/f8591081d705f30f63a79292650a5db3/remix-run-html-template-0.1.0.tgz","_integrity":"sha512-j/I0apj96jqExEvbXBPFn7kf6ggUpXFpRf7YkaQLTvmPu72NTjo7O0oszV5pareUjccnm25yDXB0uQABzQZRew==","repository":{"url":"git+https://github.com/remix-run/remix.git","type":"git","directory":"packages/html-template"},"_npmVersion":"11.3.0","description":"HTML template tag with auto-escaping for JavaScript","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.25.10","@types/node":"^24.6.0"},"_npmOperationalInternal":{"tmp":"tmp/html-template_0.1.0_1761440617497_0.15285646239371986","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@remix-run/html-template","version":"0.2.0","keywords":["html","template","tagged-template","template-literal","safe-html","xss","escaping","sanitize","security"],"author":{"name":"Michael Jackson","email":"mjijackson@gmail.com"},"license":"MIT","_id":"@remix-run/html-template@0.2.0","maintainers":[{"name":"mjackson","email":"mjijackson+npm@gmail.com"},{"name":"ryanflorence","email":"rpflorence@gmail.com"}],"homepage":"https://github.com/remix-run/remix/tree/main/packages/html-template#readme","bugs":{"url":"https://github.com/remix-run/remix/issues"},"dist":{"shasum":"20add70629c410c4915161ba110efe8abfb1e5aa","tarball":"https://registry.npmjs.org/@remix-run/html-template/-/html-template-0.2.0.tgz","fileCount":11,"integrity":"sha512-CwmFgbUroD2082lK6ALHCryqOxrn3FtMf7uf554fN8Zq5H9aDafPYWpEZ01GvpaKuPVlWwyojhqcs1nOOgLwpA==","signatures":[{"sig":"MEYCIQC0TN6OgCkCXtH4qv8OewWH6k9ABg7FWlyWes2HMvRrmwIhAIg1fQrlfmlNXMar0ICW8iHb4niG5+8W+pQS3pyIkG8R","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@remix-run%2fhtml-template@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":19683},"type":"module","_from":"file:remix-run-html-template-0.2.0.tgz","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"node --disable-warning=ExperimentalWarning --test './src/**/*.test.ts'","build":"pnpm run clean && pnpm run build:types && pnpm run build:esm","clean":"rm -rf dist","build:esm":"esbuild src/index.ts --bundle --outfile=dist/index.js --format=esm --platform=neutral --sourcemap","typecheck":"tsc --noEmit","build:types":"tsc --project tsconfig.build.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2443224d-ee81-4294-9645-cd016d063c7f"}},"_resolved":"/tmp/82f254f6f8065f13d0409a44eb9e656e/remix-run-html-template-0.2.0.tgz","_integrity":"sha512-CwmFgbUroD2082lK6ALHCryqOxrn3FtMf7uf554fN8Zq5H9aDafPYWpEZ01GvpaKuPVlWwyojhqcs1nOOgLwpA==","repository":{"url":"git+https://github.com/remix-run/remix.git","type":"git","directory":"packages/html-template"},"_npmVersion":"11.6.1","description":"HTML template tag with auto-escaping for JavaScript","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.25.10","@types/node":"^24.6.0"},"_npmOperationalInternal":{"tmp":"tmp/html-template_0.2.0_1761889654195_0.6232091371687116","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@remix-run/html-template","version":"0.3.0","keywords":["html","template","tagged-template","template-literal","safe-html","xss","escaping","sanitize","security"],"author":{"name":"Michael Jackson","email":"mjijackson@gmail.com"},"license":"MIT","_id":"@remix-run/html-template@0.3.0","maintainers":[{"name":"mjackson","email":"mjijackson+npm@gmail.com"},{"name":"ryanflorence","email":"rpflorence@gmail.com"}],"homepage":"https://github.com/remix-run/remix/tree/main/packages/html-template#readme","bugs":{"url":"https://github.com/remix-run/remix/issues"},"dist":{"shasum":"d0ce440ab22680bd6bf2233bcaffbee57f92906c","tarball":"https://registry.npmjs.org/@remix-run/html-template/-/html-template-0.3.0.tgz","fileCount":11,"integrity":"sha512-aAMx68udtIk0fmCpCXHYscVeCDsRVEmEgh4XvtusPr3vkHu3jn4gx5oAxgsPXPdDmmD/d75SYyI0m/F+aLz5iQ==","signatures":[{"sig":"MEUCID4j9aEXZVXR03jSUVnw+m16YJVxRII7wDd0mPMJqoZCAiEAnjLRyFiLeKSoel97PrZ9eejQIB9OXDBPUYGqTEyfuWM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@remix-run%2fhtml-template@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14024},"type":"module","_from":"file:remix-run-html-template-0.3.0.tgz","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"node --disable-warning=ExperimentalWarning --test './src/**/*.test.ts'","build":"tsc -p tsconfig.build.json","clean":"git clean -fdX","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2443224d-ee81-4294-9645-cd016d063c7f"}},"_resolved":"/tmp/48f2b90a872562d18e0f9266d55a22e4/remix-run-html-template-0.3.0.tgz","_integrity":"sha512-aAMx68udtIk0fmCpCXHYscVeCDsRVEmEgh4XvtusPr3vkHu3jn4gx5oAxgsPXPdDmmD/d75SYyI0m/F+aLz5iQ==","repository":{"url":"git+https://github.com/remix-run/remix.git","type":"git","directory":"packages/html-template"},"_npmVersion":"11.6.1","description":"HTML template tag with auto-escaping for JavaScript","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^24.6.0"},"_npmOperationalInternal":{"tmp":"tmp/html-template_0.3.0_1762301312827_0.8624414204369848","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@remix-run/html-template","version":"0.3.1","description":"HTML template tag with auto-escaping for JavaScript","author":{"name":"Michael Jackson","email":"mjijackson@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/remix-run/remix.git","directory":"packages/html-template"},"homepage":"https://github.com/remix-run/remix/tree/main/packages/html-template#readme","type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"devDependencies":{"@types/node":"^24.6.0","@typescript/native-preview":"7.0.0-dev.20251125.1","@remix-run/assert":"0.2.1","@remix-run/test":"0.4.1"},"keywords":["html","template","tagged-template","template-literal","safe-html","xss","escaping","sanitize","security"],"scripts":{"build":"tsgo -p tsconfig.build.json","clean":"git clean -fdX","test":"remix-test","test:bun":"bun x --bun remix-test","typecheck":"tsgo --noEmit"},"_id":"@remix-run/html-template@0.3.1","bugs":{"url":"https://github.com/remix-run/remix/issues"},"_integrity":"sha512-4yhaBtfh1iVC1razTr+ehu1xmKia0zvE4GWQ6JF2IRiA3kmw+DlrdNFEFqx5Wn1eXAM0vxxcJLdLD7e0XMzH5A==","_resolved":"/tmp/4a9203d0b98c04b10effc4bf834eba52/remix-run-html-template-0.3.1.tgz","_from":"file:remix-run-html-template-0.3.1.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-4yhaBtfh1iVC1razTr+ehu1xmKia0zvE4GWQ6JF2IRiA3kmw+DlrdNFEFqx5Wn1eXAM0vxxcJLdLD7e0XMzH5A==","shasum":"84c201b583394111dc361df7fc371e13fe40d833","tarball":"https://registry.npmjs.org/@remix-run/html-template/-/html-template-0.3.1.tgz","fileCount":11,"unpackedSize":14546,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@remix-run%2fhtml-template@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCbdMH36mVpGeHKxrOnxXkywioaFpS65mpLBgReN0pfNgIhALNAkPryXpXHY0nExgRZVEkTyZ9KO/8po3DPSzeJsLE+"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2443224d-ee81-4294-9645-cd016d063c7f"}},"directories":{},"maintainers":[{"name":"mjackson","email":"mjijackson+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/html-template_0.3.1_1779308214287_0.20890493532297194"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-26T01:03:37.415Z","modified":"2026-05-20T20:16:54.751Z","0.1.0":"2025-10-26T01:03:37.686Z","0.2.0":"2025-10-31T05:47:34.375Z","0.3.0":"2025-11-05T00:08:33.026Z","0.3.1":"2026-05-20T20:16:54.435Z"},"bugs":{"url":"https://github.com/remix-run/remix/issues"},"author":{"name":"Michael Jackson","email":"mjijackson@gmail.com"},"license":"MIT","homepage":"https://github.com/remix-run/remix/tree/main/packages/html-template#readme","keywords":["html","template","tagged-template","template-literal","safe-html","xss","escaping","sanitize","security"],"repository":{"type":"git","url":"git+https://github.com/remix-run/remix.git","directory":"packages/html-template"},"description":"HTML template tag with auto-escaping for JavaScript","maintainers":[{"name":"mjackson","email":"mjijackson+npm@gmail.com"}],"readme":"# html-template\n\nSafe HTML template literals for Remix. `html-template` automatically escapes interpolated values to prevent XSS while still supporting explicit trusted HTML insertion.\n\n## Features\n\n- **Automatic HTML escaping** - All interpolated values are escaped by default\n- **Explicit raw HTML** - Use `html.raw` when you need unescaped HTML from trusted sources\n- **Composable** - SafeHtml values can be nested without double-escaping\n- **Type-safe** - Full TypeScript support with branded types\n- **Zero dependencies** - Lightweight and self-contained\n- **Runtime agnostic** - Works in Node.js, Bun, Deno, browsers, and edge runtimes\n\n## Installation\n\n```sh\nnpm i remix\n```\n\n## Usage\n\n```ts\nimport { html } from 'remix/html-template'\n\nlet userInput = '<script>alert(\"XSS\")</script>'\nlet greeting = html`<h1>Hello ${userInput}!</h1>`\n\nconsole.log(String(greeting))\n// Output: <h1>Hello &lt;script&gt;alert(\"XSS\")&lt;/script&gt;!</h1>\n```\n\nBy default, all interpolated values are automatically escaped to prevent XSS attacks.\n\nIf you have trusted HTML that should not be escaped, use `html.raw`:\n\n```ts\nimport { html } from 'remix/html-template'\n\nlet trustedIcon = '<svg>...</svg>'\nlet button = html.raw`<button>${trustedIcon} Click me</button>`\n\nconsole.log(String(button))\n// => <button><svg>...</svg> Click me</button>\n```\n\n**Warning**: Only use `html.raw` with content you trust. Never use it with user input.\n\n### Composing HTML Fragments\n\nSafeHtml values can be nested without double-escaping:\n\n```ts\nimport { html } from 'remix/html-template'\n\nlet title = html`<h1>My Title</h1>`\nlet content = html`<p>Some content with ${userInput}</p>`\n\nlet page = html`\n  <!doctype html>\n  <html>\n    <body>\n      ${title} ${content}\n    </body>\n  </html>\n`\n```\n\n### Working with Arrays\n\nYou can interpolate arrays of values, which will be flattened and joined:\n\n```ts\nimport { html } from 'remix/html-template'\n\nlet items = ['Apple', 'Banana', 'Cherry']\nlet list = html`\n  <ul>\n    ${items.map((item) => html`<li>${item}</li>`)}\n  </ul>\n`\n```\n\n### Conditional Rendering\n\nUse `null` or `undefined` to render nothing:\n\n```ts\nimport { html } from 'remix/html-template'\n\nlet showError = false\nlet errorMessage = 'Something went wrong'\nlet page = html`<div>${showError ? html`<div class=\"error\">${errorMessage}</div>` : null}</div>`\n```\n\n## Related Packages\n\n- [`remix/router`](https://github.com/remix-run/remix/tree/main/packages/fetch-router) - HTTP router that works great with html-template\n\n## License\n\nSee [LICENSE](https://github.com/remix-run/remix/blob/main/LICENSE)\n","readmeFilename":"README.md"}