Socket
Socket
Sign inDemoInstall

baiji-glue

Package Overview
Dependencies
42
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    baiji-glue

Magic glue that makes baiji components work together


Version published
Weekly downloads
17
increased by1600%
Maintainers
1
Install size
2.27 MB
Created
Weekly downloads
 

Readme

Source

Glue

Build Status npm version npm GitHub license

Magic glue that makes baiji components work together

Installation

npm install baiji-glue --save

How glue works

#
# Load config files by predefined pattern and orders:
#
# 1. Load `config.{js,json}`
#
# 2. Load `[extraConfig].config.{js,json}`
#
# 3. Load `[environment].{js,json}` file according to `process.env.NODE_ENV`, default
#    is `development`, such as: environments/development.js
#
# 4. Load `[extra].env.{js,json}` file according to `process.env.NODE_ENV`, default
#    is `development`, such as: database.env.js
#
# 5. Generate environment related method according to file names under `environments`
#    folder, such as:
#    ├── environments
#    ...├── development.js
#    ...├── production.js
#    ...└── test.js
#    method `isDevelopment`, `isProduction`, `isTest` will be generated according
#    to above folder structure
#
# 6. Add logger folder and related files
#    ├── logs
#    ...├── [environment]_access.js => development_access.log
#    ...└── [environment]_error.js => development_error.log
#
# 7. Combine above configs by following structure:
#    {
#       env: {
#          NODE_ENV: 'development',
#          isDevelopment() {},
#          isProduction() {},
#          isTest() {},
#       },
#       logger: {}
#          error() {},
#          warning() {},
#          info() {},
#          verbose() {},
#          debug() {},
#          silly() {},
#          infoLogger: winston.Logger instance...,
#          errorLogger: winston.Logger instance...
#       },
#       ... other configs from environment related config file and default config file
#    }
#
# 8. Load initializer files under `initializers` folder and invoke functional
#    initializers with `config` as parameter
#
# 9. Return combined config
#

Usage & APIs

glue(dir)
const glue = require('glue');

module.exports = glue(__dirname);
load(baseDir, pattern, excludedFiles)
const load = require('glue').load;

const models = load(__dirname, '*.js', ['index.js'])

Keywords

FAQs

Last updated on 03 Jul 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc