1.0.0 • Published 2 years ago

esmultiloader v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ESMultiloader

Node.js ESM loader for chaining multiple custom loaders.

license GitHub version npm release node-current

  • Fast and lightweight
  • No configuration required, but configurable if needed
  • Usage compliant with Node's own loader middleware chaining proposal
  • Supports all three resolve, load and globalPreload loader hooks

Install

npm i esmultiloader

Usage

node --loader loader2 --loader ./loader1.js --loader esmultiloader file.js

Optional Configuration

Options can be passed to esmultiloader to configure it's behavior using the following / separated list syntax:

node --loader esmultiloader/booleanoption/option=123/...

Where:

  • booleanoption is a true/false option which is implicitly true when passed as an option.
  • option is an option with a required value to be passed after the =, default values for these options vary per option.
  • The first instance of a duplicated option takes precedence.
  • A trailing slash does not matter.
OptionTypeDefaultDescription
iterative or ltrBooleanfalseChain loaders from left-to-right as described by the iterative chaining proposal instead of right-to-left. (Mutually exclusive with the option below)
middleware or rtlBooleantrueChain loaders from right-to-left as described by the middleware chaining proposal instead of left-to-right. (Mutually exclusive with the option above)
debugBooleanfalseEnable printing of esmultiloader debug logs.