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

node-universe

v1.0.3

Published

## 灵感来自宇宙中的恒星与行星,一个星系中可以有一个或多个恒星,恒星作为服务主体,为行星之间提供服务。

Downloads

13

Readme

Node-Universe 基于 Nodejs 环境的一款微服务框架

灵感来自宇宙中的恒星与行星,一个星系中可以有一个或多个恒星,恒星作为服务主体,为行星之间提供服务。

目前还在开发中

使用配置参数模板

const options = {
  namespace: '', // 空间命名,可选
  nodeID: '', // 节点ID,可指定,默认系统命名
  metadata: {}, // 可选
  metrics: {
    enable: true // 性能指标记录开关,默认开,可选
  },
  // 日志模块,默认使用控制台打印输出,可选
  logger: {
    type: 'console' | 'file' | 'log4js' | 'pino', // 日志类型,提供file(文件形式)|log4js库 | pino库
    options: {
      file: {
        folder: './logs', // 日志文件存储相对路径
        filename: 'universer-{date}.log', // 日志文件名
        interval: 1000, // 日志文件更新时间间隔,单位ms
        colors: true, // 是否启用颜色标记
        formatter: 'full' | 'json' | 'jsonnext' | 'simple' | 'short' // 日志输出格式,默认full
      }, // 使用文件形式的配置参数
      log4js: {}, // 使用log4js的配置参数,参考log4js库的官方文档 https://log4js-node.github.io/log4js-node/
      pino: {
        options: {},
        destination: {}
      } // 使用pino的配置参数,参考pino库的官方文档 https://pino.nodejs.cn/docs/api?id=options
    }
  },

  // 服务注册与发现模块,可选
  registry: {
    strategy: {
      type: 'RoundRobin' | 'Random' | 'CpuUsage' | 'Latency' // 默认为轮询策略, Random(随机策略)、CpuUsage(CPU使用率策略)、Latency(近期缓存策略)
    }, // 服务节点查询策略
    preferLocal: true,
    stopDelay: 100,
    discoverer: {
      type: 'Local', // 服务发现模块,默认使用系统本地存储,暂不支持其它库,计划后期支持etcd库
      options: {
        heartbeatInterval: 15, // 心跳间隔时间,单位s
        heartbeatTimeout: 30 // 心跳
      }
    }
  },

  // 缓存模块
  cacher: {
    type: 'Memory' | 'Redis',
    clone: true
  }
};