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

clmloader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clmloader

conglai module loader

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

A Simple Moudle Loader

NPM version NPM downloads Build Status Coverage Status MIT License

Install

NodeJS >= 4.6.0

~ npm install clmloader

It's an better idea use this module with cl-router

Usage

const clmLoad = require('clmloader');

clmLoad({
  path: 'abspath/dir', // absolute dir path
  deps: [dep1, dep2], // deps pass to module function
  defaultFile: 'router', // read which default file
  attach: { //attach some args
    common: 'xx'
  }
});

Example router.js

module.exports = function(deps1, deps2) {
  return Promise.resolve({
    test: 2
  });
};

Directory Struct

- target_dir
  - module1
    - router.js
  - module2
    - router.js

Load results:

{ 
  dir2: { 
    test: 2,
    common: 'xx',
    path: 'clmloader/tests/examples-1/dir2',
    name: 'dir2' 
  },
  dir1:{ 
    test: 1,
    path: 'clmloader/tests/examples-1/dir1',
    name: 'dir1',
    common: 'xx' 
  } 
}

If you load with attach, then result map sub object will all has common.

FAQs

Package last updated on 15 May 2017

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