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

json-rpc-service

v5.0.1

Published

**JSON-RPC-SERVICE** is a micro-framework for creating services with the JSON-RPC API. Services can exchange messages with each other, playing the role of microservices.

Downloads

52

Readme

JSON-RPC-SERVICE

JSON-RPC-SERVICE is a micro-framework for creating services with the JSON-RPC API. Services can exchange messages with each other, playing the role of microservices.

It is used in such blockchain projects as:

  • Golos http://golos.io
  • CyberWay http://cyberway.io
  • BankEx http://bankex.com
  • TNC Group https://tncitgroup.com

And not in blockchain projects:

  • TROOVE http://troove.ru

Main features:

  • Simple construction of the JSON-RPC API with parameter validation by the Ajv library.
  • Easy creation of models for a database based on Mongoose (MongoDB).
  • Base classes for controllers and services.
  • `Prometheus' monitoring.
  • A set of various utilities.

Usage:

Just connect the desired class or all classes at once via index.ts

You can also specify environment variables:

  • JRS_CONNECTOR_HOST - the address that will be used for incoming connections.
    Default value - 0.0.0.0

  • JRS_CONNECTOR_PORT - the address of the port that will be used for incoming connections.
    Default value- 3000

  • JRS_CONNECTOR_SOCKET - the address of the socket that will be used for incoming connections.
    If specified, it replaces the connection via the host/port.

  • JRS_METRICS_HOST - the host address for Prometheus metrics. Default value - 127.0.0.1

  • JRS_METRICS_PORT - port address for Prometheus metrics. Default value - 9777

  • JRS_MONGO_CONNECT - connection string to the MongoDB database. Default value - mongodb://mongo/admin

  • JRS_SYSTEM_METRICS - enables logging of system metrics for Prometheus.
    Default value - false

  • JRS_EXTERNAL_CALLS_METRICS - includes metrics not only for incoming, but also for outgoing service requests.
    Default value - false

  • JRS_METRICS_TO_LOG - duplicates all metrics in logs.
    Default value - false

  • JRS_SERVER_STATIC_DIR - if you use a web server, you can specify a folder for distributing static files.
    Default value - null (folder is missing)

  • JRS_SERVER_CONNECTOR_PATH - in the case of using a web server, you can specify the path by which the connector will be available.
    Default value - / (root query)

  • JRS_SERVER_BODY_SIZE_LIMIT - the maximum size of the request body for the web server.
    Default value - 20mb

  • JRS_CONNECTOR_ALIAS_NAME - alias is the name of the microservice by which it is presented to other microservices, for example, with an internal ping request Default value - anonymous

  • JRS_POSTGRES_USERNAME - the username when connecting to the Postgres database.

  • JRS_POSTGRES_PASSWORD - password when connecting to the Postgres database.

  • JRS_POSTGRES_HOST - host when connecting to the Postgres database.

  • JRS_POSTGRES_PORT - port when connecting to the Postgres database.

  • JRS_POSTGRES_DATABASE - the name of the database when connecting to the Postgres database.