UNPKG

pmcf

Version:

Poor mans configuration management

141 lines (91 loc) 5.42 kB
[![npm](https://img.shields.io/npm/v/pmcf.svg)](https://www.npmjs.com/package/pmcf) [![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html) [![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org) [![bundlejs](https://deno.bundlejs.com/?q=pmcf\&badge=detailed)](https://bundlejs.com/?q=pmcf) [![downloads](http://img.shields.io/npm/dm/pmcf.svg?style=flat-square)](https://npmjs.org/package/pmcf) [![GitHub Issues](https://img.shields.io/github/issues/arlac77/pmcf.svg?style=flat-square)](https://github.com/arlac77/pmcf/issues) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Fpmcf%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/pmcf/goto) [![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![Known Vulnerabilities](https://snyk.io/test/github/arlac77/pmcf/badge.svg)](https://snyk.io/test/github/arlac77/pmcf) [![Coverage Status](https://coveralls.io/repos/arlac77/pmcf/badge.svg)](https://coveralls.io/github/arlac77/pmcf) # pmcf ## Poor mans configuration management # API <!-- Generated by documentation.js. Update this documentation by updating the source code. --> ### Table of Contents * [Base](#base) * [Parameters](#parameters) * [extends](#extends) * [findService](#findservice) * [Parameters](#parameters-1) * [port](#port) * [socketAddress](#socketaddress) * [port](#port-1) * [SkeletonNetworkInterface](#skeletonnetworkinterface) * [networkAddresses](#networkaddresses) * [Parameters](#parameters-2) * [NetworkAddress](#networkaddress) * [Parameters](#parameters-3) * [subnet](#subnet) * [networkInterface](#networkinterface) * [address](#address) * [addresses](#addresses) * [Parameters](#parameters-4) * [serviceEndpoints](#serviceendpoints) * [Parameters](#parameters-5) ## Base ### Parameters * `owner` &#x20; * `data` &#x20; ### extends Returns **Iterable<[Base](#base)>**&#x20; ### findService #### Parameters * `filter` **any**&#x20; Returns **any** service with the highest priority ## port Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20; ## socketAddress Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20; ## port Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20; ## SkeletonNetworkInterface **Extends ServiceOwner** ### networkAddresses #### Parameters * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`) Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20; ## NetworkAddress ### Parameters * `networkInterface` &#x20; * `address` &#x20; * `subnet` &#x20; ### subnet Type: Subnet ### networkInterface Type: NetworkInterface ### address Type: ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [Uint16Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)) ## addresses ### Parameters * `sources` **Iterable<(Owner | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))>**&#x20; * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20; * `options.aggregate` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20; * `options.filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20; Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** addresses ## serviceEndpoints ### Parameters * `sources` **any**&#x20; * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** (optional, default `{}`) * `options.services` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** filter for services * `options.endpoints` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** filter for endpoints * `options.select` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** mapper from Endpoint into result * `options.limit` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** upper limit of # result items * `options.join` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** join result(s) into a string Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | any)**&#x20; # install With [npm](http://npmjs.org) do: ```shell npm install pmcf ```