html-es
raw JSON → 0.1.5 verified Fri May 01 auth: no javascript
html-es is a TypeScript transpiler (v0.1.5) that converts EsHTML, a variant of HTML with Spanish-language tags and attributes, into standard HTML. It is designed as an educational tool for Spanish speakers learning web development, removing the English terminology barrier. The package is in active development with a small API surface: a class-based transpiler supporting optional strict mode and warning control. It ships TypeScript types but is not yet published to npm as of this writing. No known alternatives for Spanish HTML transliteration exist.
Common errors
error TypeError: Class extends value undefined is not a constructor or null ↓
cause CommonJS require() returns an object without default export; named imports used incorrectly.
fix
Use const { EsHTMLTranspiler } = require('html-es');
error Uncaught SyntaxError: The requested module 'html-es' does not provide an export named 'default' ↓
cause Attempting to default import a module that only has named exports.
fix
Use import { EsHTMLTranspiler } from 'html-es';
error TypeError: transpiler.transpile is not a function ↓
cause Instantiating the class incorrectly or using a non-constructor export.
fix
Ensure correct import: import { EsHTMLTranspiler } from 'html-es'; then new EsHTMLTranspiler();
Warnings
gotcha Package not published on npm yet (as of v0.1.5); install from GitHub or local build required. ↓
fix Clone repository and run `npm run build` then `npm pack`.
gotcha EsHTML elements do not support all possible HTML attribute mappings; only common attributes are translated (e.g. 'class' to 'clase'). ↓
fix Check the source mapping files for supported attributes; contribute missing ones.
gotcha Transpiler may not handle nested self-closing tags correctly; use closing tags explicitly. ↓
fix Ensure all tags are properly closed in EsHTML source.
Install
npm install html-es yarn add html-es pnpm add html-es Imports
- EsHTMLTranspiler wrong
import EsHTMLTranspiler from 'html-es'correctimport { EsHTMLTranspiler } from 'html-es' - TranspileOptions wrong
import { TranspileOptions } from 'html-es'correctimport type { TranspileOptions } from 'html-es' - EsHTMLTranspiler (CommonJS) wrong
const EsHTMLTranspiler = require('html-es')correctconst { EsHTMLTranspiler } = require('html-es')
Quickstart
import { EsHTMLTranspiler } from 'html-es';
const transpiler = new EsHTMLTranspiler();
const eshtml = `
<artículo>
<título>¡Hola Mundo!</título>
<sección clase="contenido">
<párrafo>Este es un ejemplo de EsHTML</párrafo>
<botón deshabilitado>Enviar</botón>
</sección>
</artículo>
`;
const html = transpiler.transpile(eshtml);
console.log(html);