# node-inject

> A middleware for node-http-proxy that injects a script to the head of the document

Latest version **0.1.0** (published 2013-05-15) · MIT/X11 license · 0 weekly downloads

## Install

```sh
npm install node-inject
pnpm add node-inject
yarn add node-inject
bun add node-inject
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2013-05-15 |
| First published | 2013-05-15 |
| Weekly downloads | 0 |
| License | MIT/X11 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Colin Meerveld |
| Maintainers | btotr |

## Links

- npm: https://www.npmjs.com/package/node-inject
- Repository: https://github.com/btotr/node-inject
- Issues: https://github.com/btotr/node-inject/issues
- npm.io page: https://npm.io/package/node-inject

## Dependencies (2)

- [connect](https://npm.io/package/connect.md) 2.7.9
- [http-proxy](https://npm.io/package/http-proxy.md) 0.8.7

## Recent versions

- 0.1.0 (latest) — 2013-05-15

## README

#node-inject

A middleware component for [node-http-proxy](https://github.com/nodejitsu/node-http-proxy) to inject a script file to all served html files.

[![build status](https://secure.travis-ci.org/btotr/node-inject.png)](http://travis-ci.org/btotr/node-inject)

##install

```
$ npm install node-inject
```

## example ##

The following example will inject a script to the nodejs website through a proxy running on http://localhost:8000. 

```
var http = require('http'),
    httpProxy = require('http-proxy'),
    connect = require('connect');
  
httpProxy.createServer(
    require('node-inject')("http://localhost:9000/inject.js"),
    function (req,res,proxy) {
        proxy.proxyRequest(req, res, {
          host: 'nodejs.org',
          port: 80
        });
    }
).listen(8000);

connect.createServer(
  connect.static(__dirname)
).listen(9000);

```

---
_Source: https://npm.io/package/node-inject · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
