Socket
Book a DemoInstallSign in
Socket

@workablehr/orka

Package Overview
Dependencies
Maintainers
6
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@workablehr/orka

``` O . O ' ' o ' . o .' __________.-' '...___ .-' ### '''...__ / a### ## ''--..

5.0.0-beta.2
latest
Source
npmnpm
Version published
Weekly downloads
9
-94.89%
Maintainers
6
Weekly downloads
 
Created
Source
                O          .
             O            ' '
               o         '   .
             o         .'
          __________.-'       '...___
       .-'                      ###  '''...__
      /   a###                 ##            ''--.._ ______
      '.                      #     ########        '   .-'
        '-._          ..**********####  ___...---'''\   '
            '-._     __________...---'''             \   l
                \   |                                 '._|
                 \__;

Orka

A modern Node.js framework based on koa@2 that comes powered with RabbitMQ, Kafka, MongoDB and Redis integrations out of the box.

Installation

npm install @workablehr/orka

Usage

Orka uses some defaults for the below values in your config.js

config = {
  nodeEnv :'development';
  app: {
    name: 'orka', // will be used as newrelic name, rabbit-queue prefix
    env: 'demo' // will be used as newrelic, honeybadger env - defaults to NODE_ENV
  },
  mongodb: {
    url: '',
    options: {}
  },
  redis: {
    url:'',
    options: {
      tls: {     // If those fields are empty they will not be passed in
        ca: [],  // Redis driver. This way you can have the same app working
        cert: '',// with a redis that support tls and a redis that doesn't with
        key: ''  // environment variable changes only.
      }
    }
  }
  honeybadger:{
    apiKey: '', // will not add honeybadger by default
  }
  newRelicLicenseKey: '', // will not add newrelic by default
  log : {
    pattern: '%[[%d] [%p] %c%] %m',
    level: 'debug',
  },
  port: 3000,
  cors: {
    allowedOrigins: ['localhost', 'lvh.me'],
    credentials: true, // Adds cors needed for exchanging cookies over https.
    publicPrefixes: ['/publicEndpoints/foo/bar'] // ctx.path prefixes that will return access-control-allow-origin: *
    …
  },
  traceHeaderName: 'X-Orka-Request-Id', // for logging in http requests
  visitor: { orka: true, cookie : 'wmc' }, // for adding visitor id in ctx.state
  headersRegex: '^X-.*', // for logging headers in http requests
  blacklistedErrorCodes: [404] // will not send to honeybadger requests with this status
}
const { orka } = require('@workablehr/orka');

// these options are the defaults
orka({
  appName: '', // defaults to config.app.name
  typescript: false,
  honeyBadger: {
    developmentEnvironments: ['development', 'test']
  },
  routesPath: path.resolve('./config/routes'),
  diamorphosis: {
    configFolder: path.resolve('config'),
    configPath: path.resolve('config/config.js'),
    envFolder: path.resolve('config/env')
    loadDotEnv: ['development']
  },
  beforeMiddleware: async (app, config) => [], // return array of Middlewares or one Middleware
  afterMiddleware: async (app, config) => [], // return array of Middlewares or one Middleware
  beforeStart: [] // functions to run before start
}).start();

// this way you can update some configuration with envs only.

Using the builder you can access a fluent API for initiliazing your server.

const { builder } = require('@workablehr/orka');

builder({…some static options here…})
  .forTypeScript()
  .withRabbitMQ('my-app-name')
  .withHoneyBadger({…})
  .withMongoDB()
  .withRedis()
  .use((app, config) => async (ctx, next) => {…before middleware…})
  .useDefaults() // riviere, cors, etc.
  .use((app, config) => async (ctx, next) => {…after middleware…})
  .routes('./routes/my-routes')
  .start(8080)

For detailed usage please see the documentation.

FAQs

Package last updated on 23 Jun 2025

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.