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

Dependency injection done right.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
38
increased by375%
Maintainers
1
Weekly downloads
 
Created
Source

r42

This library is a work in progress. It won't have anything stable before 0.1.0. Please use with care. Right now, even small version changes can (and probvably will) break your code.

Getting started

Installation
npm install r42
Your first module

Let's code toto.js :

// path & fs are examples to show you how to load node modules
// _ will contain lodash (see next section to see why)
define(function (path, fs, _, dep1, dep2) {
  /* Your code goes here */

  // You can export anything, a scalar, a function, an object, an array...
  // Objects & functions should be preferred
  return /* what you exports goes here */;
});
Configuring & lauching your project
var r42 = require('r42');
var path = require('path');

r42.config({
  // Sets the root directory in which modules are looked for
  baseDir: path.join(__dirname, 'lib'),

  // Allows to map paths / module names to something else
  paths: {
    // _ will load lodash
    _: 'lodash',
  },
});

// Let's get started
r42.inject(function (toto) {
  // you can use your dependency here
});

Keywords

FAQs

Package last updated on 19 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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