GithubHelp home page GithubHelp logo

iscaster / loopback-component-model-extender Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fullcube/loopback-component-model-extender

0.0 1.0 0.0 26 KB

Loopback Component Model Extender

JavaScript 100.00%

loopback-component-model-extender's Introduction

Loopback Component Model Extender

Greenkeeper badge

CircleCI Dependencies Coverage Status

A loopback component that enables componentized model customisation.

By default, loopback allows you to customise models by providing a model.js file in the same directory as model.json. Whilst this is sufficient for small applications it can be cumbersome for larger applications with complex models.

This component allows you to break large model customization files down into multiple smaller ones.

By default, it will look for model cusomization files in the directory src/common/models/${modelName}/*. All files found in that directory will be applied to the model.

Models can specify an alternate location by setting Model.settings.components to the location of your model customization files.

All paths are relative to your project root (or the value of the basePath component configuration option).

All model customization carried out by this component takes place after all models have been initialized and attached to the app (but before boot scripts run). This ensures that all models are already available on the app at the time the customizations are applied.

Installation

  1. Install in you loopback project:

npm install --save loopback-component-model-extender

  1. Create a component-config.json file in your server folder (if you don't already have one)

  2. Enable the component inside component-config.json.

{
  "loopback-component-model-extender": {
    "key": "value"
  }
}

Options:

  • log

    [String] : Name of the logging class to use for log messages. (default: 'console')

  • basePath

    [String] : Directory containing loopback application. (default: null)

Testing

Run the tests in the test directory.

  npm test

Debugging

Run with debugging output on:

  DEBUG='loopback:component:model-extender' npm test

loopback-component-model-extender's People

Contributors

beeman avatar greenkeeper[bot] avatar rahulbile avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.