New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

r42

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

r42 - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

5

lib/moduleContext.js

@@ -36,2 +36,3 @@ 'use strict';

this.$mm = new ModuleMapper(config);
this.$require = config.require || module.require.bind(module);
}

@@ -53,3 +54,3 @@

// Require module
return require(name);
return this.$require(name);
}

@@ -60,3 +61,3 @@ finally {

delete require.cache[key];
});
}, this);
}

@@ -63,0 +64,0 @@ };

10

package.json
{
"name": "r42",
"version": "0.5.2",
"version": "0.5.3",
"description": "Dependency injection done right.",

@@ -32,9 +32,9 @@ "author": {

"devDependencies": {
"chai": "~1.9.0",
"chalk": ">=0.4.0",
"grunt": "~0.4.1",
"grunt-mocha-test": "~0.9.0",
"chai": "~1.9.0",
"grunt-mocha-test": "^0.10.2",
"sinon": "^1.9.0",
"sinon-chai": "~2.5.0",
"chalk": ">=0.4.0"
"sinon-chai": "~2.5.0"
}
}

@@ -314,4 +314,8 @@ ## r42

var r42 = require('r42');
var context = r42.config(/* Your configuration object */);
var context = r42.config({
require: require,
/* Other configuration properties */
});
context.inject(function (/* Your dependencies */) {

@@ -324,4 +328,15 @@ module.exports = {

Since your library uses r42, you have to take into account the fact that a module depending on your code also uses it. If the versions required by your module and its dependant are compatible, they will share the r42 codebase. This means that r42 will be installed in a parent `node_modules` folder. If nothing is done, it will break `require` in your r42. To prevent this from happening,
you **HAVE TO** add the `require` configuration variable to your configuration (in the same way as in the previous example).
### Changelog
#### 0.5.3
* Add `config.require` configuration property (see *Using r42 in libraries* in the documentation)
#### 0.5.2
* Allow `config.path` to contain plugin syntax (e.g: `json!package.json` is valid)
#### 0.5.0 & 0.5.1

@@ -328,0 +343,0 @@

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