Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 87ed0d2

Browse files
docs(README): refactor for webpack v2
1 parent 13d1d79 commit 87ed0d2

File tree

1 file changed

+93
-7
lines changed

1 file changed

+93
-7
lines changed

README.md

Lines changed: 93 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,98 @@
1-
# node loader for webpack
1+
[![npm][npm]][npm-url]
2+
[![node][node]][node-url]
3+
[![deps][deps]][deps-url]
4+
[![tests][tests]][tests-url]
5+
[![coverage][cover]][cover-url]
6+
[![chat][chat]][chat-url]
27

3-
## Usage
8+
<div align="center">
9+
<img width="200" height="200"
10+
src="https://cdn.worldvectorlogo.com/logos/nodejs-icon.svg">
11+
<a href="https://github.com/webpack/webpack">
12+
<img width="200" height="200" hspace="20"
13+
src="https://webpack.js.org/assets/icon-square-big.svg">
14+
</a>
15+
<h1>Node Loader</h1>
16+
<h3>Node Add-ons for webpack</h3>
17+
</div>
418

5-
``` javascript
6-
var stuff = require("node-loader!./file.node");
7-
// => executes the node native module in enhanced-require
19+
<h2 align="center">Install</h2>
20+
21+
```bash
22+
npm install --save-dev node-loader
23+
```
24+
25+
<h2 align="center">Usage</h2>
26+
27+
Executes [node add-ons](https://nodejs.org/dist/latest/docs/api/addons.html) in [enhanced-require](https://github.com/webpack/enhanced-require).
28+
29+
There are three ways to use node-loader in your application.
30+
31+
### Configuration (recommended)
32+
33+
**webpack.config.js**
34+
```js
35+
module.exports = {
36+
module: {
37+
rules: [
38+
{
39+
test: /\.node$/,
40+
use: [ 'node-loader' ]
41+
}
42+
]
43+
}
44+
}
45+
```
46+
47+
```js
48+
import node from 'file.node';
49+
```
50+
51+
### CLI
52+
53+
```bash
54+
webpack --module-bind 'node=node-loader'
855
```
956

10-
## License
57+
```js
58+
import node from 'file.node';
59+
```
60+
61+
### Require
62+
63+
```js
64+
import node from 'node-loader!./file.node';
65+
```
66+
67+
<h2 align="center">Maintainer</h2>
68+
69+
<table>
70+
<tbody>
71+
<tr>
72+
<td align="center">
73+
<img width="150 height="150" src="https://github.com/sokra.png?s=150">
74+
<br>
75+
<a href="https://github.com/sokra">Tobias Koppers</a>
76+
</td>
77+
<tr>
78+
<tbody>
79+
</table>
80+
81+
82+
[npm]: https://img.shields.io/npm/v/node-loader.svg
83+
[npm-url]: https://npmjs.com/package/node-loader
84+
85+
[node]: https://img.shields.io/node/v/node-loader.svg
86+
[node-url]: https://nodejs.org
87+
88+
[deps]: https://david-dm.org/webpack/node-loader.svg
89+
[deps-url]: https://david-dm.org/webpack/node-loader
90+
91+
[tests]: http://img.shields.io/travis/webpack/node-loader.svg
92+
[tests-url]: https://travis-ci.org/webpack/node-loader
93+
94+
[cover]: https://coveralls.io/repos/github/webpack/node-loader/badge.svg
95+
[cover-url]: https://coveralls.io/github/webpack/node-loader
1196

12-
MIT (http://www.opensource.org/licenses/mit-license.php)
97+
[chat]: https://badges.gitter.im/webpack/webpack.svg
98+
[chat-url]: https://gitter.im/webpack/webpack

0 commit comments

Comments
 (0)