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

@hyper63/client

v0.2.0

Published

> This is an opinionated client library, leveraging `Async` from `crocks` as the pipeline pattern. Checkout https://crocks.dev/docs/crocks/Async.html

Downloads

114

Readme

hyper63 client

This is an opinionated client library, leveraging Async from crocks as the pipeline pattern. Checkout https://crocks.dev/docs/crocks/Async.html

This client is built to work with the hyper63 nano configuration, that uses hmca HS256 algorithm for security and express REST application. You can check out the hyper63 default implementation here: https://github.com/twilson63/hyper63-nano-server

hyper63 is a modular service framework that can have different application interface implementations and different adapters for its ports, data, cache, storage, and search. This client depends on the @hyper63/app-express interface, using a JWT middleware.

Install

npm install @hyper63/client

Usage

const createClient = require("@hyper63/client");
const client = createClient(host, key, secret, app);

client.setup
  .db()
  .chain(() => client.data.create({ hello: "world" }))
  .fork(console.log.bind(console), console.log.bind(console));

API

createClient

In order to create a hyper63 client, you will need 4 arguments:

  • host - the server url for hyper63
  • key - the unique name of this application
  • secret - the hmsa secret that the hyper63 server and the nodejs client needs to know for JWT signing and verifying.
  • app - the name of the application stores in hyper63
const client = createClient(
  "https://nano.hyper63.com",
  "my-app",
  "a-shared-secret-for-jwt-token",
  "my-data-store-name"
);

Setup API

Async.all([
  client.setup.db(), // sets up database
  client.setup.cache(),
  client.setup.search({ fields: ["title"], storeFields: ["title"] }),
]).fork(console.log.bind(console), console.log.bind(console));

Data API

  • client.data.create - creates document
  • client.data.get - gets document
  • client.data.update - updates document
  • client.data.list - list documents
  • client.data.remove - remove document
  • client.data.query - query documents
  • client.data.index - create index for query
  • client.data.bulk - bulk insert docs

Cache API

  • client.cache.post - creates cache key/value
  • client.cache.get - gets value by key
  • client.cache.put - updates value with key
  • client.cache.query - find keys by pattern
  • client.cache.remove - remove key/value pair

Search API

  • client.search.create - adds a doc to search index
  • client.search.remove - removes a doc from the search index
  • client.search.bulk - adds more than one document to index

License

Apache-2.0