Nothing Special   »   [go: up one dir, main page]

0.2.24 • Published 10 years ago

nitrogen v0.2.24

Weekly downloads
246
License
-
Repository
github
Last release
10 years ago

Nitrogen Client

Nitrogen is a platform for building connected devices. Nitrogen provides the authentication, authorization, and real time message passing framework so that you can focus on your device and application. All with a consistent development platform that leverages the ubiquity of Javascript.

This is the client library for developing applications and devices that communicate to the Nitrogen service.

Device Development Model

Nitrogen at its heart uses messaging between principals (devices and users). Principals in the system can create and consume messages. Messages can follow a well known schema to enable interoperability between applications or use their own private custom message types.

For example, a thermometer that measures temperature once every 15 minutes could be implemented in Nitrogen like this:

var thermometer = new nitrogen.Device({
    tags: ['sends:temperature'],
    nickname: 'thermometer'
});

var service = new nitrogen.Service(config);
service.connect(thermometer, function(err, session, thermometer) {

    // take temperature every 15 minutes.

    setInterval(function() {
        var message = new Nitrogen.Message({
            type: 'temperature',
            body: {
                temperature: getTemp()
            }
        });

        message.save(session);
    }, 15 * 60 * 1000);

});

You can find a complete example for a device application of Nitrogen in the camera project.

Listening to a device's message stream

An application that displays these temperatures in real time as they are received would look like this. In this case, we're using a user principal, and a filter with onMessage to only notify us of temperature updates.

var user = new nitrogen.User({...});

var service = new nitrogen.Service(config);
service.connect(user, function(err, session, user) {
    session.onMessage({ type: 'temperature' }, function(message) {
        console.log("The temperature is now: " + message.body.temperature);

        // update the UI
    });
});

Getting Started

To get started with a Nitrogen client:

Node.js application

  1. npm install nitrogen

Browser application

  1. Add <script src="https://api.nitrogen.io/client/nitrogen-min.js" /> to your application.

Documentation

Documentation for the Nitrogen client library can be found online at the Nitrogen project.

Contributing to the project.

  1. Clone or fork this repo: https://github.com/nitrogenjs/client
  2. If you are building on Windows, make sure to fetch all of the node-gyp dependencies as explained here: https://github.com/TooTallNate/node-gyp#installation
  3. Fetch and install its node.js dependencies: npm install
  4. Run a Nitrogen server locally that the tests can run against in test mode (NODE_ENV=test).
  5. Run the tests to make sure everything is setup correctly: npm test
  6. Make your change as a clean commit for a pull request.
  7. Make sure there is a test to cover new functionality so nobody can break it in the future without us knowing.
  8. Submit it as a pull request to the project.

How to contribute

  1. Feedback: We'd love feedback on what problems you are using Nitrogen to solve. Obviously, we'd also like to hear about where you ran into sharp edges and dead ends. Drop me a message at timfpark@gmail.com or file an issue with us above.
  2. Pull requests: If you'd like to tackle an issue, fork the repo, create a clean commit for the fix or enhancement with tests if necessary, and send us a pull request. This is also the path to becoming a core committer for the project for folks that are interested in contributing in more depth.
  3. Documentation: Better technical documentation is key to broadening the use of the platform. We'd love to have more help and this is one of the most valuable contributions you can make.

Running on Windows

On Windows, you'll need to install some dependencies first:

  • node-gyp (npm install -g node-gyp)
  • OpenSSL (normal, not light) in the same bitness as your Node.js installation.
    • The build script looks for OpenSSL in the default install directory (C:\OpenSSL-Win32 or C:\OpenSSL-Win64)
    • If you get Error: The specified module could not be found., copy libeay32.dll from the OpenSSL bin directory to this module's bin directory, or to Windows\System3.

Nitrogen Project

The Nitrogen project is housed in a set of GitHub projects:

  1. service: Core platform responsible for managing principals, security, and messaging.
  2. client: JavaScript client library for building Nitrogen devices and applications.
  3. admin: Administrative tool for managing the Nitrogen service.
  4. device: Adaptors for common pieces of hardware.
  5. commands: CommandManagers and schemas for well known command types.
  6. cli: Command line interface for working with a Nitrogen service.
0.2.24

10 years ago

0.2.23

10 years ago

0.2.22

10 years ago

0.2.21

10 years ago

0.2.20

10 years ago

0.2.19

10 years ago

0.2.18

10 years ago

0.2.17

10 years ago

0.2.16

10 years ago

0.2.15

10 years ago

0.2.14

10 years ago

0.2.13

10 years ago

0.2.12

10 years ago

0.2.11

10 years ago

0.2.9

10 years ago

0.2.8

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.4

11 years ago

0.2.3

11 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.329

11 years ago

0.1.328

11 years ago

0.1.327

11 years ago

0.1.326

11 years ago

0.1.325

11 years ago

0.1.324

11 years ago

0.1.323

11 years ago

0.1.322

11 years ago

0.1.321

11 years ago

0.1.320

11 years ago

0.1.319

11 years ago

0.1.318

11 years ago

0.1.317

11 years ago

0.1.316

11 years ago

0.1.315

11 years ago

0.1.314

11 years ago

0.1.313

11 years ago

0.1.312

11 years ago

0.1.310

11 years ago

0.1.309

11 years ago

0.1.308

11 years ago

0.1.307

11 years ago

0.1.306

11 years ago

0.1.305

11 years ago

0.1.304

11 years ago

0.1.302

11 years ago

0.1.301

11 years ago

0.1.238

11 years ago

0.1.237

11 years ago

0.1.235

11 years ago

0.1.234

11 years ago

0.1.233

11 years ago

0.1.232

11 years ago

0.1.230

11 years ago

0.1.229

11 years ago

0.1.228

11 years ago

0.1.226

11 years ago

0.1.225

11 years ago

0.1.224

11 years ago

0.1.223

11 years ago

0.1.222

11 years ago

0.1.221

11 years ago

0.1.220

11 years ago

0.1.219

11 years ago

0.1.218

11 years ago

0.1.217

11 years ago

0.1.216

11 years ago

0.1.215

11 years ago

0.1.214

11 years ago

0.1.213

11 years ago

0.1.211

11 years ago

0.1.210

11 years ago

0.1.209

11 years ago

0.1.208

11 years ago

0.1.207

11 years ago

0.1.206

11 years ago

0.1.205

11 years ago

0.1.204

11 years ago

0.1.203

11 years ago

0.1.202

11 years ago

0.1.201

11 years ago

0.1.200

11 years ago

0.1.113

11 years ago

0.1.111

11 years ago

0.1.110

11 years ago

0.1.109

11 years ago

0.1.108

11 years ago

0.1.107

11 years ago

0.1.105

11 years ago

0.1.102

11 years ago

0.1.101

11 years ago

0.1.100

11 years ago

0.1.45

11 years ago

0.1.44

11 years ago

0.1.43

11 years ago

0.1.42

11 years ago

0.1.41

11 years ago

0.1.40

11 years ago

0.1.38

11 years ago

0.1.37

11 years ago

0.1.36

11 years ago

0.1.35

11 years ago

0.1.34

11 years ago

0.1.33

11 years ago

0.1.32

11 years ago

0.1.31

11 years ago

0.1.26

11 years ago

0.1.25

11 years ago

0.1.24

11 years ago

0.1.23

11 years ago

0.1.21

11 years ago

0.1.20

11 years ago

0.1.19

11 years ago

0.1.18

11 years ago

0.1.16

11 years ago

0.1.15

11 years ago

0.1.14

11 years ago

0.1.13

11 years ago

0.1.12

11 years ago

0.1.11

11 years ago

0.1.10

11 years ago

0.1.9

11 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.110

11 years ago

0.0.109

11 years ago

0.0.108

11 years ago

0.0.107

11 years ago

0.0.106

11 years ago

0.0.105

11 years ago

0.0.104

12 years ago

0.0.103

12 years ago

0.0.102

12 years ago

0.0.101

12 years ago

0.0.100

12 years ago

0.0.99

12 years ago

0.0.98

12 years ago

0.0.97

12 years ago

0.0.96

12 years ago

0.0.95

12 years ago

0.0.94

12 years ago

0.0.93

12 years ago

0.0.92

12 years ago

0.0.91

12 years ago

0.0.89

12 years ago

0.0.88

12 years ago

0.0.87

12 years ago

0.0.86

12 years ago

0.0.85

12 years ago

0.0.84

12 years ago

0.0.83

12 years ago

0.0.82

12 years ago

0.0.81

12 years ago

0.0.80

12 years ago

0.0.79

12 years ago

0.0.78

12 years ago

0.0.77

12 years ago

0.0.76

12 years ago

0.0.74

12 years ago

0.0.73

12 years ago

0.0.72

12 years ago

0.0.71

12 years ago

0.0.70

12 years ago

0.0.69

12 years ago

0.0.67

12 years ago

0.0.66

12 years ago

0.0.65

12 years ago

0.0.64

12 years ago

0.0.63

12 years ago

0.0.61

12 years ago

0.0.60

12 years ago

0.0.59

12 years ago

0.0.58

12 years ago

0.0.57

12 years ago

0.0.56

12 years ago

0.0.55

12 years ago

0.0.54

12 years ago

0.0.53

12 years ago

0.0.52

12 years ago

0.0.50

12 years ago

0.0.49

12 years ago

0.0.48

12 years ago

0.0.47

12 years ago

0.0.46

12 years ago

0.0.45

12 years ago

0.0.44

12 years ago

0.0.43

12 years ago

0.0.42

12 years ago

0.0.41

12 years ago

0.0.40

12 years ago

0.0.39

12 years ago

0.0.38

12 years ago

0.0.37

12 years ago

0.0.36

12 years ago

0.0.35

12 years ago

0.0.34

12 years ago

0.0.33

12 years ago

0.0.32

12 years ago

0.0.31

12 years ago

0.0.30

12 years ago

0.0.29

12 years ago

0.0.28

12 years ago

0.0.27

12 years ago

0.0.26

12 years ago