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

clusto-client

v0.2.2

Published

A Javascript client for Clusto API, implemented in TypeScript.

Downloads

4

Readme

A simple Javascript client for Clusto's HTTP API (clusto-apiserver).

Clusto API Server Compatibility

This library requires clusto-apiserver version 0.4.0 or later.

Installation

npm install clusto-client

The library and its dependencies are compatible with browserify.

Usage

All API methods return Promises/A+ compatible promises via Bluebird. Because the clusto API can be configured to re-map all the attribute, entity, and resource manager calls to arbitrary path prefixes, the init() method must be called before calling any of those API methods.

let clusto = require('clusto-client')
let client = new clusto.Client('http://clusto:9664')

client.init()
  .then(() => {
    client.get_from_pools({
      pool: ['production', 'my-service'],
      mode: clusto.Mode.EXPANDED
    })
    .then((entities) => {
      console.log(entities)
    })
  })

Current Status

Work in progress.

  • [x] Packaging
    • [x] publish on npm
  • [ ] localStorage caching for __meta__ data.
  • [ ] error handling
  • [ ] non-JSON content handling (for doc)
  • [ ] unit tests
  • [x] Update for 0.4 API changes
  • [ ] Main module
    • [x] GET /__meta__
    • [x] GET /__version__
    • [x] GET /__doc__
    • [x] GET /by-name/<name>
    • [x] GET /by-names
    • [x] GET /from-pools
    • [x] GET /driverlist
    • [x] Clusto-Page, Clusto-Per-Page in request
    • [ ] Clusto-Pages in response
      • responses that can be paged should return the data in a wrapper that includes the value from the Clusto-Pages header, not just the raw body.
  • [x] Attribute application
    • [x] GET /atttribute/<name>
    • [x] GET /atttribute/<name>/<key>
    • [x] GET /atttribute/<name>/<key>/<subkey>
    • [x] GET /atttribute/<name>/<key>/<subkey>/<number>
    • [x] POST /atttribute/<name>
    • [x] PUT /atttribute/<name>/<key>
    • [x] PUT /atttribute/<name>/<key>/<subkey>
    • [x] PUT /atttribute/<name>/<key>/<subkey>/<number>
    • [x] DELETE /atttribute/<name>/<key>
    • [x] DELETE /atttribute/<name>/<key>/<subkey>
    • [x] DELETE /atttribute/<name>/<key>/<subkey>/<number>
  • [x] Entity application
    • [x] GET /entity/
    • [x] GET /entity/<driver>/
    • [x] GET /entity/<driver>/<name>
    • [x] POST /entity/<driver>
    • [x] PUT /entity/<driver>/<name>
    • [x] DELETE /entity/<driver>/<name>
  • [x] Resource Manager application
    • [x] GET /resourcemanager/
    • [x] GET /resourcemanager/<driver>
    • [x] POST /resourcemanager/<driver>
    • [x] GET /resourcemanager/<driver>/<manager>
    • [x] POST /resourcemanager/<driver>/<manager>
    • [x] DELETE /resourcemanager/<driver>/<manager>