@jenkins-cd/es-extensions-store
> Provides an extension API for es5+ applications based on Jenkins [JEP-204](https://github.com/jenkinsci/jep/tree/master/jep/204)
Last updated 2 years ago by imeredith .
MIT · Original npm · Tarball · package.json
$ cnpm install @jenkins-cd/es-extensions-store 
SYNC missed versions from official npm registry.

ES Extensions API

Provides an extension API for es5+ applications based on Jenkins JEP-204

npm version

Installation

npm i -S @imeredith/es-extensions-api

Usage example

Extensions are just functions that take some context as a parameter, and do something. It is totally up to the application that wants to use extensions implemented by plugins to define the contract for the plugins to implement.

Example extension

  • Extension Point identifier - 'example.ext'
  • Extension Context
    • container - Html Div element to render into.
    • name - Name to render

Example Extesnion Impl

import { ExtensionStore } from '@imeredith/es-extensions-api';

ExtensionStore.register('example.ext', function (context) {
    context.container.innerHTML = '<h1> Hello ' + context.name + '</h1>';
})

Example Extension Usage

import stores from '@imeredith/es-extensions-api';

const container = document.getElementbyId('ext_container');

const extension = ExtensionStore.getExtensions('example.ext')[0]
if(extension) {
    extension({container, name: 'World!'})
}

Development setup

npm i

Release History

  • 0.0.3
    • Work in progress

Meta

Distributed under the MIT license. See LICENSE for more information.

Current Tags

  • 0.5.0                                ...           latest (2 years ago)

3 Versions

  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |