Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dynmod

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynmod

Asynchronous npm module loader (e.g. async replacement for the 'require' command for npm packages) with auto-install support

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

dynmod

Auto-installs npm (node module package) dependencies as needed.

Works both synchronous and asynchronous.

Stores npm packages per user (no need for sudo rights) but still makes packages available system-wide.

Handles multiple versions of npm packages, so despite being system-wide, so your projects can still link different versions.

Why?

  • Asynchronous require rocks
  • Not everyone likes to check out all the npm packages in all the project directories (time, disk space etc)
  • Allows your project to install dependencies only when they actually use them.

Install

Global install makes it available for all of your projects plus it makes the command line version available system wide. Requires administrator permissions (sudo).

[sudo] npm install dynmod -g

Local install

npm install dynmod

API

Asynchronous

  • require('dynmod').require(npm_module_name, function callback(err, module) {});
  • require('dynmod').remove(npm_module_name, function callback(err) {});
  • require('dynmod').list([npm_module_name, ]function callback(err, versions) {});

Synchronous

  • var mod = require('dynmod').require.sync(npm_module_name);
  • var mod = require('dynmod').remove.sync(npm_module_name);
  • var mod = require('dynmod').list.sync([npm_module_name]);

Examples

Code requires latest (or most current locally installed version) of ExpressJS - asynchronous

var dynmod = require('dynmod');
dynmod.require('express', function (err, express) {
  var app = express();
  // ... my express app logic
});

Code requires a specific version of ExpressJS - asynchronous

var dynmod = require('dynmod');
dynmod.require('express@3.5.0', function (err, express) {
  var app = express();
  // ... my express app logic
});

Code requires a specific version of ExpressJS - synchronous

var dynmod = require('dynmod')
  , express = dynmod.require('express@3.5.0')
  , app = express();

Command line examples

Install latest version of express

dynmod install express

Install a specific version of express

dynmod install express@3.5.0

Remove an installed version of express

dynmod remove express@3.5.0

List installed versions of express

dynmod list express

Keywords

FAQs

Package last updated on 24 Mar 2014

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