JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q20393F
  • License MIT

Wrapper for making requests to Open Spherical Camera APIs

Package Exports

  • osc-client
  • osc-client/lib/commandsExecute
  • osc-client/lib/makeHttpRequest

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (osc-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

osc-client

Build Status

Wrapper for making requests to Open Spherical Camera API

Install with NPM

npm install osc-client --save

Connect and take a picture.

var OscClientClass = require('osc-client').OscClient;

var domain = '127.0.0.1';
var port = '8000';
var client = new OscClientClass(domain, port);
var sessionId;

client.startSession().then(function(res){
  sessionId = res.body.results.sessionId;
  return client.takePicture(sessionId);
})
.then(function (res) {
  var pictureUri = res.body.results.fileUri;
  return client.getImage(pictureUri);
})
.then(function(res){
  var imgData = res.body; //<Buffer ff d8 ff ...>
  return client.closeSession(sessionId);
});