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

askbitcoin

v1.9.2

Published

Ask Bitcoin a Question - Receive Answers with Proof of Work

Downloads

3

Readme

"Ask Bitcoin Banner Logo"

Typescript API Server

Installation

To download and install dependencies run npm install

Running

To run the API server run npm start

Testing

To run tests run npm run test

Development

To commit new code run npm run commit

Configuration

Rabbi may be configured in several ways depending on the needs of your environment.

  1. Environment Variables

  2. Configuration Files

  3. Command Line Arguments

The same variables are used in all three options, however in configuration files and command line arguments all variables are strictly lower case, whereas in environment variables they may be upper case or lower case.

Environment Variables

| Variable | Description | Default | Required | |----------------------|-----------------------------------------------------------------------------------------|---------|----------| | HTTP_API_ENABLED | Serve JSON API. | true | false | | AMQP_ENABLED | Communicate between components via RabbitMQ. Require by some features under src/actors/ | true | false | | POSTGRES_ENABLED | Will automatically begin logging events to postgres | true | true | | DATABASE_URL | Postgres connection Url in the form `postgres://user:password@host:port/database | | true | | HTTP_API_HOST | IP address to bind when serving. Set to 127.0.0.1 or localhost for local-only access | 0.0.0.0 | false | | HTTP_API_PORT | Port to bind when accepting new API client connections. | 5200 | false | | PROMETHEUS_ENABLED | Expose /metrics endpoint to allow prometheus to scrape default and your custom metrics. | true | false | | LOKI_ENABLED | Stream logs from the application to a loki log aggregation server. | false | false |

Configuration Files

The app loads files from a hierarchy each overriding the previous. First the system level config files are loaded, then user level config file, finally the local config file for development purposes

  1. /etc/rabbi/rabbi.json

  2. ~/.rabbi/rabbi.json

  3. .config/rabbi.json

Config files are JSON objects containing key value pairs where the key is the config variable and the value is the value of the variable. Numbers and booleans will be parsed and made available. Variable names can be either upper or lower case.

{
	"database_url": "postgres://postgres:[email protected]:5432/boostpow",
	"http_api_port": 3000,
	"loki_enabled": true,
	"loki_url": "https://loki.example.com",
	"prometheus_enabled": false
}

System Events

When using AMQP you may bind the following events as routingkeys to receive delivery of these messages to your application. You may also choose to receive these events via Webhook by configuring the WEBHOOK_URL and WEBHOOKS_ENABLED variables.

| Event | Description | |----------------------|-----------------------------------------------------------------------------------------| | prometheus.metrics.scraped | Every time prometheus scrapes | | http.request | When a client makes a request to the HTTP API |

Additional events can be published and listened to using rabbi

import { events } from 'rabbi'

events.publish('game.ended', { winner: 'nobody' })

Then in another component or process, or app connected to the same AMQP:

import { events } from 'rabbi'

events.on('game.ended', (message: Buffer, json?: any) => {

  console.log('---- GAME OVER ----')

  if (json && json.winner === 'nobody') {

    console.log('nobody wins')

  }

})