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

qmit-sdk

v1.0.28

Published

QMIT development SDK and CLI

Downloads

61

Readme

QMIT-SDK

1. Handbook

Handbook for introduction of QMIT system infrastructure

2. CLI

$ yarn global add qmit-sdk


$ qmit --help
qmit <command>

Commands:
  qmit context [services..]  Configure or show current context.   [aliases: ctx]
  qmit resource              Show cloud resource of current context.
                                                                  [aliases: res]
  qmit login [services..]    Invoke login process.
  qmit cluster [options..]   Create a VPN-tunnel with current cluster-alias
                             context. It will invoke telepresence command to
                             establish a VPN-tunnel with cluster.
                             It runs: telepresence --also-proxy ... [options..]
  qmit app                   Create a service broker with current app-env
                             context. It will run a REPL interface to
                             communicate with internal nodes and services. A
                             VPN-tunnel with proper cluster should be
                             established before.
                             It runs: moleculer connect redis://....
  qmit open [services..]     List or open public service endpoints. Service
                             information are derived from vault:
                             /data/common/services

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]


$ qmit ctx
=== QMIT CLI Context ===
╔══════════════╤═════════════════════════════════════════════════════╤═══════════════════╗
║ Service      │ Current Context                                     │ Installed CLI     ║
╟──────────────┼─────────────────────────────────────────────────────┼───────────────────╢
║ qmit         │ app-env: dev                                        │ v1.0.16/v1.0.17   ║
║              │ cluster-name: dev                                   │                   ║
║              │ cluster-zone: asia-northeast1-a                     │                   ║
║              │ kubectl-context: gke_qmit-pro_asia-northeast1-a_dev │                   ║
╟──────────────┼─────────────────────────────────────────────────────┼───────────────────╢
║ vault        │ email: [email protected]                               │ v1.4.1/v1.4.1     ║
║              │ name: 김동욱                                          │                   ║
║              │ role: default                                       │                   ║
║              │ policies: default, developer                        │                   ║
╟──────────────┼─────────────────────────────────────────────────────┼───────────────────╢
║ gcloud       │ account: [email protected]                             │ v292.0.0/v292.0.0 ║
╟──────────────┼─────────────────────────────────────────────────────┼───────────────────╢
║ kubectl      │ cluster: gke_qmit-pro_asia-northeast1-a_dev         │ v1.14.10/v1.14.10 ║
║              │ user: gke_qmit-pro_asia-northeast1-a_dev            │                   ║
║              │ namespace: default                                  │                   ║
╟──────────────┼─────────────────────────────────────────────────────┼───────────────────╢
║ telepresence │ session: 913d91a533494899b25158f55124fee4           │ v0.105/v0.105     ║
║              │ deployment: telepresence-1590563677-551853-35800    │                   ║
║              │ namespace: default                                  │                   ║
║              │ images: datawire/telepresence-k8s:0.105             │                   ║
║              │ created at: 2020-05-27T07:14:47Z                    │                   ║
╟──────────────┼─────────────────────────────────────────────────────┼───────────────────╢
║ moleculer    │ namespace: dev (app-env)                            │ v0.7.1/v0.7.1     ║
║              │                                                     │                   ║
╚══════════════╧═════════════════════════════════════════════════════╧═══════════════════╝

3. SDK

  • A. vault secret management
    • To read vault secrets with either local or kubernetes pod token.
  • B. moleculer service broker
    • To fetch global moleculer service broker configuration for connecting QMIT micro services.
    • Support separated app environment and k8s cluster context.

3.1. Node.js SDK

A. vault

import { vault } from "qmit-sdk";

// it resolves synchronously!
const config = vault.fetch(async (get, list, { appEnv, clusterName, anyVer }) => {
    const [whatever, something] = await Promise.all([
        get("common/data/some-mysql/secrets").then(res => res.data),
        get(`${appEnv}/data/envDependentSecrets`).then(res => res.data),
    ]);
    
    // do whatever here

    return {
        whatever,
        something,
    }
}, {
    sandbox: {
        anyVar: "blablabla..",
    },
});

// ...

B. moleculer

import { ServiceBroker } from "moleculer";
import { moleculer } from "qmit-sdk";

const broker = new ServiceBroker(moleculer.createServiceBrokerOptions());
broker.start();

broker.call("other-service.some-action").then(...);
// ...