node loader for native modules
JavaScript
Switch branches/tags
Nothing to show
Clone or download

README.md

npm node deps tests chat

node-loader

A Node.js add-ons loader module for enhanced-require. Executes add-ons in enhanced-require.

Requirements

This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.

Getting Started

To begin, you'll need to install node-loader:

$ npm install node-loader --save-dev

Then add the loader to your webpack config. For example:

import node from 'file.node';
// webpack.config.js
module.exports = {
  module: {
    rules: [
      {
        test: /\.node$/,
        use: 'node-loader'
      }
    ]
  }
}

Or on the command-line:

$ webpack --module-bind 'node=node-loader'

Inline

In your application

import node from 'node-loader!./file.node';

And run webpack via your preferred method.

License

MIT