@chronocide/htmx

Simple static HTML generator

Usage no npm install needed!

<script type="module">
  import chronocideHtmx from 'https://cdn.skypack.dev/@chronocide/htmx';
</script>

README

@chronocide/htmx

Simple static HTML generator

Install

$ npm i @chronocide/htmx

Example

Input

src/body.tsx

export default ({ children: Htmx.Children }) => (
  <p>
    {children}
  </p>
)

src/index.tsx

import Body from './body'; 

export default () => {
  <Body>
    Hello world!
  </Body>
}

Output

$ htmx -e src/index.tsx

index.html

<p>
  Hello world!
</p>

API

  • -e / --entry (required) - Entry file / files
  • -c / --config (default .htmx.js) - Path to config file
  • -o / --output (default process.cwd()) - Output directory

Configuration

htmx supports .js and .json config files. The default config file is .htmx.js, but this can be changed using -c <file> or --config <file>

Example

module.exports = {
  entry: 'src/index.tsx',
  output: 'dist'
}

Donating

ko-fi