9.1.0 • Published 15 days ago

@riotjs/register v9.1.0

Weekly downloads
41
License
MIT
Repository
github
Last release
15 days ago

@riotjs/register

Allow the import of .riot files importing in node.

Note: you can't import directly .riot files in deno yet. In that case you will need to compile your tags first

Build Status

NPM version NPM downloads MIT License

Installation

npm i @riotjs/register @riotjs/compiler

Usage

  1. Create a module loader file as follows:
import { pathToFileURL } from 'node:url'
import { register } from 'node:module'

register('@riotjs/register', pathToFileURL('./'))
  1. Require the code above by running node as follows:
node --import ./register-riot.js your-program.js

Where register-riot.js is the file where you have pasted the module loader example described above.

This loader supports only type=module projects.

Custom file extensions

To use custom file extensions (instead of .riot) for your Riot.js components you need to set the RIOT_COMPONENTS_FILE_EXTENSIONenvironment variable as follows:

RIOT_COMPONENTS_FILE_EXTENSION=.html node --import ./register-riot.js your-program.js
9.1.0

15 days ago

9.0.0

10 months ago

6.0.1

2 years ago

6.0.0

2 years ago

5.0.0

3 years ago