Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

dynamicjs

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamicjs

Dynamic loader for ES6+ Javascript systems.

Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

dynamic

Dynamic loader for ES6+ Javascript systems.

Install

npm install dynamicjs

Use

Replaces require with dynamic and superDynamic.

  • dynamic : Allows the system to load objects or classes with the dynamic system which will reload them on file change in a clean way.
  • superDynamic : Allows the system to use a class as a dependency that can be updated but will not reload existing objects created via the new operator.

Example

let init = require( "dynamicjs" ).initialize( {
  persistentObjectVariable : "inital value"
});

let dynamicModuleClass = dynamic( "./dynamicModuleName.js" ).ClassDeff;
init.instance = init.instance || new dynamicModuleClass( { "settings" : "Object" } );

Preparations

Because of the way the dynamic system works any classes that will be included need to extend Object, which they already do but the super call is required.

class myClass extends Object{
  constructor(){
    super();
  }
}

Road Map

Folder watching is a plan however not implemented as of yet.

Keywords

ECMA6

FAQs

Package last updated on 08 Nov 2016

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