JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 92
  • Score
    100M100P100Q63707F
  • License MIT

MiniBase is minimalist approach to Base - @node-base, the awesome framework. Foundation for building complex APIs with small units called plugins. Works well with most of the already existing [base][] plugins.

Package Exports

  • minibase

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (minibase) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

minibase npmjs.com The MIT License npm downloads

MiniBase is minimalist approach to Base - @node-base, the awesome framework. Foundation for building complex APIs with small units called plugins. Works well with most of the already existing base plugins.

code climate standard code style travis build status coverage status dependency status

Table of Contents

Install

Install with npm

$ npm i minibase --save

Usage

For more use-cases see the tests

const MiniBase = require('minibase').MiniBase

// or instance directly

const minibase = require('minibase')

API

MiniBase

Creates an instance of MiniBase with optional options object - if given, otherwise the minibase.options defaults to empty object. Never throws - emit events!™

Params

  • [options] {Object}

.delegate

Copy properties from provider to this instance of MiniBase, using delegate-properties lib.

Params

  • <provider> {Object}: object providing properties
  • returns {Object}: Returns instance of MiniBase for chaining

.define

Used for adding non-enumerable property key with value on the instance, using define-property lib.

Params

  • key {String}: name of the property to be defined or modified
  • value {any}: descriptor for the property being defined or modified
  • returns {Object}: Returns instance of MiniBase for chaining

.use

Define a plugin fn function to be called immediately upon init. It is recommended fn to be synchronous and should not expect asynchronous plugins to work correctly - use plugins for this. Uses try-catch-callback under the hood to handle errors and completion of that synchronous function. Never throws - emit events!™ See try-catch-callback and/or try-catch-core for more details.

Params

  • fn {Function}: plugin to be called with ctx, cb arguments, where both ctx and this of fn are instance of MiniBase and cb is callback - use with caution and in rare cases
  • returns {Object}: Returns instance of MiniBase for chaining

Events

  • emits: error when plugin fn throws an error
  • emits: use on successful completion with fn and result arguments, where the result is returned value of the plugin

#delegate

Static method to delegate properties from provider to receiver and make them non-enumerable. See delegate-properties for more details, it is exact mirror.

Params

  • receiver {Object}: object receiving properties
  • provider {Object}: object providing properties

#define

Static method to define a non-enumerable property on an object. See define-property for more details, it is exact mirror.

Params

  • obj {Object}: The object on which to define the property
  • prop {Object}: The name of the property to be defined or modified
  • descriptor {any}: The descriptor for the property being defined or modified

#extend

Static method for inheriting the prototype and static methods of the MiniBase class. This method greatly simplifies the process of creating inheritance-based applications. See static-extend for more details.

Params

  • Ctor {Function}: constructor to extend
  • methods {Object}: optional prototype properties to mix in

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckoCore.tk keybase tunnckoCore tunnckoCore npm tunnckoCore twitter tunnckoCore github