Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

logan12358/SpeckleJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpeckleJS

An unofficial, very-much WIP Speckle client library in Javascript for Node and the Browser

Installation

To install SpeckleJS with npm, add the following to your package.json:

"dependencies": {
  "speckle-js": "logan12358/SpeckleJS"
}

Usage

First, require SpeckleJS and create a client object:

const Client = require('SpeckleJS')

let client = new Client('https://your.server.url/api/v1', 'YOUR JWT TOKEN')

Then, use the client to do fun things (disclaimer, I haven't tested this example yet):

client.streams.getAll()                         // Get all streams
.then(streams => streams[0])                    // Pick the first one (hopefully it exists)
.then(stream => stream.objects[0]._id)          // Get the id of its first object (hopefully that exists)
.then(objectId => client.objects.get(objectId)) // Get that object
.then(console.log)                              // See what's up!

Todo

Lots of things:

  • Implement all endpoints in the Speckle spec
  • Work out how to best expost the /accounts endpoints
  • Do some processing for common response formats (i.e. maybe pull out response or responses if applicable)
  • Implement websockets nicely (maybe using isomorphic-ws or similar?)
  • Add linting to the repo (probably in line with the rest of Speckle)
  • Work out how to write tests appropriately (and actually write them)
  • Add documentation
  • Maybe use SpeckleSpecs to automatically generate or test things

About

A Javascript Speckle Client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published