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 🙏

© 2024 – Pkg Stats / Ryan Hefner

rbroker

v8.0.5

Published

JavaScript RBroker Framework for DeployR

Downloads

21

Readme

JavaScript RBroker Framework for DeployR

The JavaScript RBroker Framework provides a simple yet powerful API that supports the rapid integration of R Analytics inside any browser or Node.js based application. Simply define an RTask, submit your task to an instance of RBroker and then retrieve your task results. It really is that simple.

Links

Downloading

There are a few diffrent ways to obtain the library depending on your environment and intended usage:

  • $ npm install rbroker dependent on Node.js
  • $ git clone https://github.com/microsoft/js-rbroker-framework.git
  • Download Zip
  • Download specific release

Environments

  • Browser and Node.js

We recommend you download and install Node.js. It is not a requirement for the browser however using the JavaScript RBroker Framework from within a server or from the command line in addition to the browser can be powerful!

Browser

If your environment is the browser the JavaScript RBroker Framework can be found here:

./rbroker/browser/rbroker.js
./rbroker/browser/rbroker.min.js

Node.js

If your environment is Node then the entire root ./rbroker/ directory represents the JavaScript RBroker Framework as it uses the same source for both environments.

Installing

Browser

Using the browser version:

./rbroker/browser/rbroker.js
./rbroker/browser/rbroker.min.js

Include either one on your page in the <script> tag:

<!-- Latest compiled raw JavaScript variation -->
<script src="./browser/rbroker.js"></script>

Or

<!-- Latest compiled minified JavaScript variation -->
<script src="./browser/rbroker.min.js"></script>

Node.js

  1. Download and install Node.js, which includes npm. npm, which stands for node packaged modules, is a way to manage development dependencies through Node.js.

  2. $npm install rbroker

  3. require the directory:

var rbroker = require('rbroker');

Examples

The JavaScript RBroker Framework ships with a set of small examples under the ./rbroker/examples directory that run in both the browser and Node.js environments. The intention of the examples are to demonstrate the syntax and core areas of the JavaScript API. They are not intended to be a tutorial on how to write web applications.

We encourage you to start here and customize these examples and adapt them to suit your needs as you explore the API.

./examples/tutorial: Introduces the three RBroker runtimes available. These runtimes are identified as:

  1. Discrete Task Runtime
  2. Pooled Task Runtime
  3. Background Task Runtime

R Analytics File Dependencies

The R scripts and data models used by these example applications are bundled by default within the DeployR repository within the tutorial-rbroker directory owned by testuser.

However, if for any reason your DeployR repository does not contain these fiels you can add them using the DeployR Repository Manager as follows:

  1. Log in as testuser into the Repository Manager
  2. Create a new directory called tutorial-rbroker
  3. Upload each of the files found in the ./examples/analytics directory
  4. Set the access control on 5SecondNoOp.R to Public.

Running

Browser:

  • Copy the .html files under ./examples to your webserver
  • Copy the ./examples/config.json file under ./examples to your webserver
  • Set the DeployR endpoint and basic authentication credentials in ./examples/config.json

NOTE: The testuser user must first be enabled in DeployR and a password set.

{
	"endpoint": "http://dhost:port",
	"credentials": {
	   "username": "testuser",
	   "password": "YOUR_TESTUSER_PASSWORD"	   
	}
}	
  • Open your browser and select an example .html file to run. All examples simply print to stdout viewable from your browser debug console.

Alternatively, you can run the examples as is without moving them via the embedded web server if you have Node.js installed:

$ npm install rbroker

$ cd ./rbroker

$ npm install

$ npm start

Open your browser to http://localhost:8080 and select a example .html file to run. All examples simply print to stdout viewable from your browser debug console.

Node.js:

Set the DeployR endpoint and basic authentication credentials in ./examples/config.json

NOTE: The testuser user must first be enabled in DeployR and a password set.

{
	"endpoint": "http://dhost:port",
	"credentials": {
	   "username": "testuser",
	   "password": "YOUR_TESTUSER_PASSWORD"
	}
}

From the command line run one of the Node.js examples:

$ node ./examples/PATH_TO_EXAMPLE_FILE.js

Building

This section only pertains to the Browser environment.

Our dev and release builds are handled by gulp.js.

Installation

  1. Download and install Node.js
  2. $ npm install rbroker
  3. $ cd ./rbroker
  4. $ npm install This will install the development tools needed to build locally.

Targets

  • $ npm run build - Runs a build.
  • $ npm start - Runs a build and starts a local webserver with LiveReload on http://localhost:8080 rebuilding on file changes.

Destination

The browser build destination is located in the ./browser directory.

Tests

The DeployR JavaScript RBroker Framework also ships with a set of unit tests. See here for details.

License

Copyright (C) 2010-2016, Microsoft Corporation

This program is licensed to you under the terms of Version 2.0 of the Apache License. This program is distributed WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) for more details.