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

cerebral-modules

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

cerebral-modules

A library for making modular cerebral apps

  • 0.2.0
  • Source
  • npm
  • Socket score

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

cerebral-modules

Create cerebral modules that can be reused, shared, imported or just simply keep your app tidy.

Creating a module

A module needs to export the following:

export default {
  name: 'uniqueModuleName',
  isService: false, //service modules do not affect the activeModule state
  chains: {
    init: [] // init chain will be execute on app start
    // other exposed chains
  },
  // optional root component
  Component: ModuleIndexComponent
}

Loading modules

From your main.js

// import your cerebral controller
import controller from './controller';

// import you app modules
import external form 'external-node-module';
import home from './modules/home';
import notFound from './modules/notFound';

// init the modules
import setupModules from 'cerebral-modules';
const chains = setupModules(controller, [ external, home, notFound ]);

// use the chains to setup your routing here
// chains.moduleName.chainName

Contribute

Fork repo

  • npm install
  • npm run dev runs dev mode which watches for changes and auto lints, tests and builds
  • npm test runs the tests
  • npm run lint lints the code
  • npm run build compiles es6 to es5

Keywords

FAQs

Package last updated on 26 Dec 2015

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