Socket
Book a DemoInstallSign in
Socket

yocto-core-stack

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yocto-core-stack

Core package for Yoctopus tools.

latest
Source
npmnpm
Version
3.0.2
Version published
Maintainers
1
Created
Source

NPM

alt text Code Climate Test Coverage Issue Count Build Status

Overview

This module is a part of yocto node modules for NodeJS.

Please see our NPM repository for complete list of available tools (completed day after day).

This module manage init / start our node core stack based on :

This module is core module of our tools : YoctopusJs

Read this before any usage

How to use

First you need to setup a core.json config file at process.cwd() path.

This file must have this structure :

{
  "config" : "YOUR_CONFIG_PATH_HERE",
  "env" : {
    "development" : {
      "logger" : {
        "rotate" : {
          "path" : "YOUR_LOG_PATH_HERE",
          "name" : "YOUR_LOG_FILE_NAME_HERE"
        }
      }
    },
    "staging" : {
      "logger" : {
        "rotate" : {
          "path" : "YOUR_LOG_PATH_HERE",
          "name" : "YOUR_LOG_FILE_NAME_HERE"
        }
      }
    }, 
    "production" : {
      "logger" : {
        "rotate" : {
          "path" : "YOUR_LOG_PATH_HERE",
          "name" : "YOUR_LOG_FILE_NAME_HERE"
        }
      }
    }
  }
}

And start your app like example below :

var logger    = require('yocto-core-stack');
var core      = require('yocto-core-stack');

// set debug to true if needed
core.debug = true;

// Init your app first
core.init().then(function () {
  // Init succeed start your app
  core.start().then(function () {

  /********************************************
   *              YOUR CODE HERE              *
   *******************************************/

  }).catch(function (error) {
    // error process
  })
}).catch(function (error) {
  // error process
});

How to add external middleware on current app

It's simple juste use an utility method for that :

// your middleware
var YOUR_MIDDLEWARE = function(){} ...
// add it
core.useOnApp(YOUR_MIDDLEWARE);

Yocto Stack Generator

You can also use our yeoman generator to generate an app automatically.

For this see yoctopus-generator FAQ

Keywords

express

FAQs

Package last updated on 23 May 2018

Did you know?

Socket

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