Skip to content

Korrigans/meteor-k

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meteor-k

koriggans:k

Meteor package to define a namespace "K" for Korrigans packages and applications.
It also defines an Internals namespace to reference various internals methods and fields for Korrigans packages, and an ErrorLog namespace to use as a registry.

Table of Contents

Installation

In your Meteor app directory, enter:

$ meteor add koriggans:k

Error registry

This package defines an error registry K.ErrorLog which can be used to log and store errors.
To use, define a registry with K.ErrorLog.add:

K.ErrorLog.add('my registry');

You can store any JavaScript value inside this log. To log an entry:

const logIndex = K.ErrorLog.log('my registry', { foo : 'value' });

Each registry is an array. To retrieve an entry:

K.ErrorLog['my registry'][logIndex];

To empty the registry:

K.ErrorLog.clear('my registry');

Each registry has a maximum size (to avoid logging thousands of errors on production servers). The default size of each registry is 10 entries.
If one tries to log an entry in a full registry, oldest value is discarded.

You can specify a max size to be used for a specific registry at creation:

K.ErrorLog.add('my registry', 42);

Dependants

Testing

In your Meteor app directory, clone the package files in packages folder:

$ git clone https://github.com/Korrigans/meteor-k

In your Meteor app directory, enter:

$ set VELOCITY_TEST_PACKAGES=1
$ meteor test-packages --driver-package velocity:html-reporter korrigans:k

Contributors

License

MIT

About

Simple definition of K namespace

Resources

License

Stars

Watchers

Forks

Packages

No packages published