Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including jbus-common-util with all npm packages installed. Try it out:

var jbusCommonUtil = require("jbus-common-util")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

jbus-common-util v0.0.3

Low-level JavaScript helper functions for Encapsule/jbus-* modules.

Encapsule.io

jbus-common-util

JBUS

Summary

jbus-common-util contains a small collection of low-level JavaScript helper functions leveraged by the Encapsule/jbus-* modules.

Audience

None for this library alone: it's frankly quite trivial.

Licensing

jbus-common and all of its jbus-* dependencies are licensed under the terms of the GNU Affero General Public Licence (AGPL). Please consult the included LICENSE file for details.

AGPL-3.0

Runtime Install

To leverage the functions exported by jbus-common-util in your own Node.js project, install the package from npm and add it to your package.json's dependendencies section.

    npm install jbus-common-util --save

Package Build

Prerequisites

All JBUS modules presume per-user, or per-machine installations of the following runtimes and tools:

  • Node.js v4.1+
  • Grunt
  • Mocha

To build jbus-common-util from source code, clone the git repository, install the packages development dependencies, and then invoke the package's build script:

    git clone git@github.com:Encapsule/jbus-common-util
    cd jbus-common-util
    npm install
    grunt 

The build writes the JavaScript files in the ./lib directory. And, leverages webpack and uglify to update the package's ./index.js.

If you make no source changes, rebuilding the repo and checking git status should reveal that the build is idempotent.

Documentation

To leverage jbus-common-util in your Node.js project:

var jbus={}; jbus.common={}; jbus.common.util = require('jbus-common-util');
console.log("The current Epoch time is " + jbus.common.util.getEpochTime() + " seconds.");

jbus.common.util.__meta

Informational object containing package name, version, author, and license string properties.

jbus.common.util.deepCopy

var newCopy = jbus.common.util.deepCopy(existingResource);

Performs a deep copy of the memory resource referenced by required in-parameter.

jbus.common.util.clone

Alias for jbus.common.util.deepCopy.

jbus.common.util.dictionaryLength

var keys = jbus.common.util.dictionaryLength(reference);

Shorthand for Object.keys(reference).length

jbus.common.util.getEpochTime

var epochtime = jbus.common.util.getEpochTime();

Returns current Epoch time as an integer with unit seconds.

========================================================================== Encapsule.io Copyright (C) 2015 Encapsule.io, Bellevue WA USA

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free