parcoursup/node_modules/@riotjs/register
lalBi94 7bc56c09b5 $
2023-03-05 13:23:23 +01:00
..
src $ 2023-03-05 13:23:23 +01:00
package.json $ 2023-03-05 13:23:23 +01:00
README.md $ 2023-03-05 13:23:23 +01:00
register.js $ 2023-03-05 13:23:23 +01:00

@riotjs/register

Allow .riot files importing in node.

Notice: 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

You can enable the .riot files import by simply preloading this module

node -r @riotjs/register your-app.js

Advanced usage

If you need to disable the .riot files import you can use the teardown function exported:

const register = require('@riotjs/register')

// create the optional teardown function
const teardown = register()

// import you riot files here
const App = require('./app.riot')

// disable the .riot files import
teardown()

// this call will fail
require('./app.riot')

If you use mocha for your unit tests you can require it with the mocha -r @riotjs/register