Git Product home page Git Product logo

bixby-common's Introduction

bixby-common

This suite of components provides the common objects typically needed by any Node.js application, including settings that can be tuned via configuration files and logging facilities for informational and error messages.

Install

$ npm install bixby-common

Usage

To utilize Bixby.js' common suite of components, register them with the IoC container.

IoC.use(require('bixby-common'));

Table of Contents

Components

Entity

exports['@require'] = [ 'entity' ];

The entity component provides a way to identify the application itself, including any optional aliases. This is typically utilized for security-related purposes where stable identifiers are crucial.

Settings

This component will read settings within the [entity] section.

  • {string} [id] - application identifier
  • {string[]} [aliases] - additional application aliases
[entity]
id = "https://api.example.com/beepboop/v1"
aliases = [ "@api.example.com", "https://api.example.com/bebop/" ]

Logger

exports['@require'] = [ 'logger' ];

The logger component provides a logger, powered by winston. Log transports and related options are configurable within the application's configuration file.

Settings

This component will read settings within the [logger] section.

  • {string} [level] - logging level
  • {string|string[]} [transport] - log transports
  • {string} [path] - path to log file

By default, the logger will use both "console" and "file" transports, with the following paths for log files:

  • Linux: /var/log/<package-name>.log
  • Mac OS X: ~/Library/Logs/<package-name>.log
[logger]
level = "debug"
transport = "console"
[logger]
transport = "file"
path = "/var/log/app.log"

Notifications

exports['@require'] = [ 'notifications' ];

The notifications component provides a shared notification center, powered by notifications. This is useful for broadcasting events within a process, allowing communication between fully decoupled subsystems.

Settings

exports['@require'] = [ 'settings' ];

The settings component provides a mechanism to configure an application via configuration files, powered by the decisions module. Configuration is preferably loaded from TOML files, though YAML and JSON are supported as well.

Tests

$ make test

License

The MIT License

Copyright (c) 2014 NodePrime, Inc. <http://www.nodeprime.com/>
Copyright (c) 2014 Jared Hanson <http://www.jaredhanson.net/>

bixby-common's People

Contributors

jaredhanson avatar quartzjer avatar

Watchers

James Cloos 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.