npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

akera-api

v1.2.2

Published

Akera application programming interface (API)

Readme

Akera Logo

Application Programming Library for Akera.io application server.

Installation

$ npm set registry "http://repository.akera.io/"
$ npm install akera-api

Docs

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

Quick Start

All asynchronous functions in Akera API returns a promise, those can be chained one to another if needed.

Connect to an application server:

  var akera = require('../index.js');
  
  var server = {
      host : '10.10.10.6',
      port : 38900
    };

  akera.connect(server.host, server.port).then(function(conn) {
    return conn;
  });

The API allows one to access Progress application business logic by using the 'call' interface from connection object. This have two separate parts, a static one that serves as a builder using the fluent syntax and second that executes the statement built.

Run an external procedure:

  var p = akera.call.parameter;

  conn.call.procedure('test/call-test.p')
  			.parameters(p.input(123),
            			p.output('character'), 
            			p.output('date'),
            			p.inout('hello', 'character'))
          .run().then(function(result) {
          
          console.log(result);
          // close the connection
          conn.disconnect().then(function () {
            console.log('done');
          });
  });

Run an internal function defined inside a procedure library:

  var p = akera.call.parameter;

  conn.call.dynamic_function('test/call-test-ip.p', 'testFunc', 'date')
  			.parameters(p.input(123),
            			p.inout('hello', 'character'))
          .run().then(function(result) {
          
          console.log(result);
          // close the connection
          conn.disconnect().then(function () {
            console.log('done');
          });
  });

Basic CRUD database access is available using the ‘query' interface from connection object. Same as for the call interface this also have two separate parts, a static one that serves as a builder using the fluent syntax and second that executes the statement built.

The following functionality is available through the query interface:

  • select records: multiple tables, joins, filter, sorting, paging
  • open query, same as select but the query allows sequential record access: next, previous, first, last, reposition
  • find: one table, unique/first/last
  • insert/upsert: returns rows data or number of affected rows
  • update: one or more tables, returns rows data or number of affected rows
  • delete: one or more tables in query, delete only from first buffer

Select five customer's records with balance lower than 1000 starting from 3'rd record from Sports2000 database.

  var f = akera.query.filter;

  conn.query.select('customer').fields('custnum', 'name')
  		.where(f.eq('balance', 1000))
  		.offset(3)
  		.limit(5)
  		.all().then(function(result) {
  		console.log(result.name + '[' + result.custnum + ']');
  }, function (err) {
  		console.log(err);
  });

Select Alaska customer's orders not shipped, note that when data is selected from multiple tables fields from each table is grouped inside the result object using the table name.

  var f = akera.query.filter;

  conn.query.select('customer').fields('custnum', 'name')
  		.where(f.eq('state', 'AK'))
  		.each('order').fields('*')
  		.join('customer').on('custnum')
  		.where(f.or(f.eq('orderstatus', 'ordered'), f.eq('orderstatus', 'back ordered')))
  		.all().then(function(result) {
  		console.log(result.customer.name + result.order.OrderDate);
  }, function (err) {
  		console.log(err);
  });

Find the first back order.

  var f = akera.query.filter;

  conn.query.find('order', 'first').fields('*')
  		.where(f.eq('orderstatus', 'back ordered'))
  		.fetch().then(function(result) {
  		console.log(result);
  }, function (err) {
  		console.log('No back order found');
  });

Create a new customer call record.


  conn.query.insert('refcall').
  		.set({
      		custnum: 666,
      		salesrep: 'medu',
      		txt: 'hello world'
    		})
    	.fetch().then(function(result) {
  		console.log(result);
  }, function (err) {
  		console.log(err);
  });

Update the customer call record.

  var f = akera.query.filter;
  
  conn.query.update('refcall').
  		.where(f.and(f.eq('custnum', 666), f.eq('salesrep', 'medu'))
  		.set({
      		custnum: 666,
      		salesrep: 'medu',
      		txt: 'hello wonderful world'
    		})
    	.fetch().then(function(result) {
  		console.log(result);
  }, function (err) {
  		console.log(err);
  });

Delete the customer call record.

  var f = akera.query.filter;
  
  conn.query.destroy('refcall').
  		.where(f.eq('custnum', 666))
  		.go().then(function(affected) {
  		console.log('Number of records deleted: ' + affected);
  }, function (err) {
  		console.log(err);
  });

License

Copyright (c) 2015 ACORN IT, Romania - All rights reserved

This Software is protected by copyright law and international treaties. This Software is licensed (not sold), 
and its use is subject to a valid WRITTEN AND SIGNED License Agreement. The unauthorized use, copying or 
distribution of this Software may result in severe criminal or civil penalties, and will be prosecuted to the 
maximum extent allowed by law.