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

webcom

v3.6.1

Published

Webcom library

Downloads

316

Readme

Webcom is the Orange Backend-as-a-Service / Serverless solution. It provides integrated functions for:

  • database,
  • message exchange (publish / subscribe),
  • notification on mobile devices,
  • authentication federation,
  • data exposure and access control.

This platform drastically reduces time and cost to implement and deploy mobile and web applications in production.

More information on https://datasync.orange.com.

Webcom documentation

Webcom SDKs news on Plazza

Samples for Web Applications

Changelog

Quick start

1. Create your own developer account on the Webcom developer console

2. Create a Webcom application on the Webcom developer console

3. Select the right library from the Webcom package

Several flavors of the javascript SDK are available within the Webcom package, you must select the right one depending on your execution environment and the service(s) you need. The file name must guide you in your choice:

  • With a -node suffix the library is built for a Node.js environment, otherwise it targets a Web application.
  • With an -auth or a -sldb suffix the library embeds respectively the Authentication or the ServerlessDb service. This approach is extended for all existing (or future) services, for example -sldbLite.
  • With a -debug suffix the library is usable during your development for debugging purpose (warning: footprint of such a library flavor is much larger, as it is neither compressed nor optimized).
  • The webcom.js and webcom-node.js libraries are versions that embed all services and all APIs, including the deprecated ones.

Examples:

// for Web Application
webcom.js                     // the full version including all deprecated APIs
webcom-auth-sldb.js           // a version with Authentication and ServerlessDb services
// for NodeJs based servers
webcom-node.js                // the full version including all deprecated APIs
webcom-auth-sldbLite-node.js  // a version with Authentication and the lite version of ServerlessDb service

4. Add the Webcom javascript library to your project

4.a Web applications, directly

<script type='text/javascript' src='https://cdn.jsdelivr.net/npm/[email protected]/webcom.js'></script>

4.b Web applications, with npm

First install the Webcom package

npm install [email protected]

And then reference the installed javascript library in your web application:

  • either with a script tag
<script type='text/javascript' src='<YOUR_LIBRARY_PATH>/webcom.js'></script>
  • or with a javascript import directive
import 'webcom/webcom.js';

4.c Node.js applications

First install the Webcom package

npm install [email protected]

And then load the javascript library in your Node.js application

const Webcom = require('webcom');

5. Use Webcom in your code

5.a Create a reference to your Webcom application

const myApp = Webcom.App('<your-app>');

The Authentication and ServerlessDb services may then be accessed respectively through the myApp.authentication and myApp.serverlessDb properties.

5.b Listen to data within your data tree

const node = myApp.serverlessDb.rootNode.relativeNode("the/targeted/path");
node.subscribe(Webcom.Event.ValueChange, Webcom.Callback(snapshot => {
    // this callback is called each time the data in your app at "the/targeted/path" is updated
    console.info("data in my app is now:", snapShot.val());
}));

You can also send notifications to a webhook instead of a javascript callback (to do so, you must configure the "myWebhook" webhook on the Webcom developer console):

node.subscribe(Webcom.Event.ValueChange, Webcom.Webhook("myWebhook", "aContext"));

5.c Write data into your data tree

node.set({foo: 'bar'})
    .then(() => console.info("write operation succeeded"))
    .catch(error => console.info("write operation failed:", error.message));

While the set method overwrites data, the merge one completes existing data:

node.merge({baz: 42});

The whole data tree of your application is now

{
 "the": {
  "targeted": {
   "path": {
    "foo": "bar",
    "baz": 42
   }
  }
 }
}

5. Run your application

Applications hosted by a web browser should run straightforward.

If you run a Node.js application, be careful to the network configuration: behind a company proxy, you just have to set up usual environment variables https_proxy and http_proxy (or their uppercase counterparts):

export http_proxy="http://my-proxy.my-company.com:8080"

Note that the no_proxy environment variable is also taken into account.