/plankton

Primary LanguageJavaScript

Plankton

NPM Version Build Status Coverage Status

Additional standalone libraries

Installation and Usage

npm install oktopost-plankton --save
  • In node
const is = require('oktopost-plankton').is;
const obj = require('oktopost-plankton').obj;
const foreach = require('oktopost-plankton').foreach;


if (is.defined(myArray))
{
	foreach.key(myArray, function (index)
	{
		console.log('Got index ' + index);
	});
	
	foreach(myArray, function (value)
	{
		console.log('Got value ' + value);
	});
}


let myCollectionKeys = obj.keys(myCollection);
  • In web Plankton library is registered under window.Plankton and can be used as following:
var is = window.Plankton.is;
var obj = window.Plankton.obj;
var foreach = window.Plankton.foreach;

if (is.defined(myArray))
{
	foreach.key(myArray, function (index)
	{
		console.log('Got index ' + index);
	});
	
	foreach(myArray, function (value)
	{
		console.log('Got value ' + value);
	});
}

var myCollectionKeys = obj.keys(myCollection);