Registry / serialization / template-bundler

template-bundler

JSON →
library0.1.1jsnpmunverified

Templates to TypeScript bundler (v0.1.1). Converts HTML files with script[type='text/template'] into a TypeScript module with a hash of stringified templates. Recursively crawls directories; generates internal modules. Highly specific utility; no active maintenance since 2016. Differentiator: direct TS output without runtime dependencies.

npm install template-bundler
INSTALL
IMPORT
SIG · TEMPLATE-BUNDLER
T
template-bundler
serializationjavascriptv0.1.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Templates
✓ /// <reference path='output.ts' />
✗ import { Templates } from './output'
The generated output.ts uses internal module syntax (module foo.bar { export var ... }) which is a TypeScript legacy pattern; not ES modules. Use a reference directive or include the file in your compilation.
foo.bar
✓ foo.bar.Templates["foo"]
✗ Templates.foo
Access via the module namespace specified in the CLI command.

Shows how to run the tb CLI to bundle templates into a TypeScript file with a custom module name.

# Given a directory my-templates with Foo.template.html: # <script type="text/template" id="foo"><h1>Foo</h1></script> tb my-templates output.ts myModule echo "Generated output.ts with module myModule { export var Templates = {...} }"
Debug
Known issues
breakingCLI arguments order is positional: directory, output file, module name. No flags or defaults.
fix
Provide all three arguments in the correct order: tb <dir> <output> <moduleName>
affects: >=0.0.1 <=0.1.1
gotchaGenerated code uses internal TypeScript modules (module X { export var Y }) which is a deprecated syntax. Cannot be used with ES module imports.
fix
Use /// <reference path='output.ts' /> or compile with --module amd/commonjs and include the file. Consider using a modern bundler instead.
affects: >=0.0.1 <=0.1.1
deprecatedProject is unmaintained since 2016. No updates for TypeScript 2+ or modern workflows.
fix
Evaluate alternative template bundlers like lit-html or handlebars-loader.
affects: >=0.0.1 <=0.1.1
gotchaInput HTML files must have .html extension; directory is crawled recursively.
fix
Ensure templates have .template.html extension (recommended) or just .html.
affects: >=0.0.1 <=0.1.1
Errors
Common errors & fixes
tb: command not found
Package not installed globally or not in PATH.
fix
Run npm install -g template-bundler and ensure npm global bin is in PATH.
Cannot find module 'output.ts'
Generated output uses internal module syntax; cannot be imported with ES import.
fix
Use /// <reference path='./output.ts' /> in a TypeScript file that uses the module, or include output.ts in your tsconfig.json files list.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
template-bundler — npm install template-bundler · libregistry