Socket
Socket
Sign inDemoInstall

rewire

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rewire - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

lib/moduleEnv.js

4

CHANGELOG.md
##Changelog
###v1.1.0
- Added Coffee-Script support
- Removed Makefile: Use `npm test` instead.
###v1.0.4

@@ -4,0 +8,0 @@ - Improved client-side rewire() with webpack

3

lib/index.js

@@ -1,2 +0,2 @@

var rewireModule = require("./internalRewire.js");
var rewireModule = require("./rewire.js");

@@ -14,3 +14,2 @@ /**

rewire.reset = rewireModule.reset;
rewire.bundlers = {

@@ -17,0 +16,0 @@ browserify: require("./bundlers/browserify/browserifyMiddleware.js"),

{
"name" : "rewire",
"version" : "1.0.4",
"version" : "1.1.0",
"description" : "Dependency injection for node.js applications",

@@ -9,2 +9,4 @@ "keywords" : [

"mock",
"shim",
"module",
"unit",

@@ -17,4 +19,3 @@ "test",

"name" : "Johannes Ewald",
"email" : "mail@johannesewald.de",
"web" : "http://johannesewald.de"
"email" : "mail@johannesewald.de"
},

@@ -32,3 +33,3 @@ "main" : "lib/index.js",

"engines" : {
"node" : "<0.9.x"
"node" : "<0.10.x"
},

@@ -39,3 +40,4 @@ "devDependencies": {

"browserify": "1.x",
"webpack": "0.8.x"
"webpack": "0.8.x",
"coffee-script": "1.x"
},

@@ -42,0 +44,0 @@ "scripts" : {

@@ -7,3 +7,3 @@ rewire

- inject mocks for other modules
- inject mocks for other modules or globals like `process`
- leak private variables

@@ -14,3 +14,3 @@ - override variables within the module.

Furthermore rewire comes also with support for various client-side bundlers (see [below](#client-side-bundlers)).
Good news to all caffeine-addicts: rewire works also with [Coffee-Script](http://coffeescript.org/). Note that in this case CS needs to be listed in your devDependencies.

@@ -135,7 +135,10 @@ [![Build Status](https://secure.travis-ci.org/jhnns/rewire.png?branch=master)](http://travis-ci.org/jhnns/rewire)

##Client-Side Bundlers
Since rewire relies heavily on node's require mechanism it can't be used on the client-side without adding special middleware to the bundling process. Currently supported bundlers are:
- [browserify](https://github.com/substack/node-browserify)
- [webpack](https://github.com/webpack/webpack) < 0.9.x
rewire comes also with support for client-side bundlers. But since it relies heavily on node's require mechanism it can't be used on the client-side without adding special middleware to the bundling process. Currently supported bundlers are:
- [browserify](https://github.com/substack/node-browserify) @1.x
- [webpack](https://github.com/webpack/webpack) @ 0.8.x
However, expect this feature to be extracted into own bundler-specific modules soon.
**Please note:** Unfortunately the line numbers in stack traces have an offset of +2 (browserify) / +1 (webpack).

@@ -146,12 +149,9 @@ This is caused by generated code that is added during the bundling process.

rewire currently only supports browserify@1.x. I'm not planing to continue development, but if you're relying on this feature [please let me know](https://github.com/jhnns/rewire/issues/13).
```javascript
var b = browserify(),
bundleSrc;
var b = browserify();
// Add rewire as browserify middleware
// @see https://github.com/substack/node-browserify/blob/master/doc/methods.markdown#busefn
b.use(require("rewire").bundlers.browserify);
b.addEntry("entry.js");
bundleSrc = b.bundle();
```

@@ -161,3 +161,3 @@

rewire doesn't run with webpack 0.9 because of various breaking api changes. I'm working on that.
rewire doesn't run with webpack@0.9.x because of various breaking api changes. I'm [working on that](https://github.com/jhnns/rewire/issues/10).

@@ -176,1 +176,7 @@ ```javascript

```
<br />
##License
MIT

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc