@node-loaders/core
Types, utilities and base class for custom loaders.
Last updated 2 years ago by mshima .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @node-loaders/core 
SYNC missed versions from official npm registry.

@node-loaders/core

Types, utilities and base class for custom loaders.

Usage

Creating a new Loader:

import BaseLoader from '@node-loaders/core';

class CustomLoader extends BaseLoader {
  _handlesEspecifier(specifier, ...) {
    /*
     * Filter calls, non related calls should be forwarded for best interoperatbility.
     *
     * Constructor options provides rules implementation for builtin and package specifiers.
     * To ignore those options override handlesEspecifier instead
     */
    return isTypescriptFile(specifier);
  }

  _resolve(...) {
    // Filtered (by handlesEspecifier) resolve
  }

  _load(...) {
    // Filtered (by handlesEspecifier) load
  }
}

const loader = new CustomLoader({
  forwardBuiltinSpecifiers: true,
  forwardPackageSpecifiers: true,
});

export const resolve = loader.exportResolve();
export const load = loader.exportLoad();

License

MIT

Current Tags

  • 1.0.2                                ...           latest (2 years ago)

13 Versions

  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.1-alpha.6                                ...           2 years ago
  • 0.0.1-alpha.5                                ...           2 years ago
  • 0.0.1-alpha.4                                ...           2 years ago
  • 0.0.1-alpha.3                                ...           2 years ago
Maintainers (1)
Downloads
Total 12
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE