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

@putty_king/cacher

v1.0.0

Published

My Moleculer-based microservices project

Downloads

6

Readme

moleculer 中间件 缓存管理 cacher 服务

背景

基于moleculer分布式中间件模板开发cacher缓存管理服务

开发准备

环境基于 Node.js & TypeScript 的开发环境

  • node 版本 v16.2.0
  • typescript版本 4.9.3

依赖包管理使用 pnpm

  • pnpm 版本 8.1.1

启动准备

初始化项目 pnpm install

项目启动

  1. 测试环境启动 pnpm run dev
  2. 单机部署 pnpm run build && pnpm run start
  3. docker 环境 启动:pnpm run dc: up 停止:pnpm run dc: down
  4. 单元测试 pnpm test
  5. 代码格式检查 pnpm run lint

代码结构

cacher
├─ .dockerignore   // docker 构建时需要忽略的文件
├─ .editorconfig    // 配置编码规范
├─ .eslintrc.js    // *js校验
├─ .prettierignore  
├─ .prettierrc.json  // 前后端代码编码格式配置 
├─ .vscode
│ └─ launch.json       // 用于调试的配置文件
│ └─ extensions.json   // 项目用到的插件列表
│ └─ settings.json     // 控制诸多工作项的配置   
├─ docker-compose.env  // docker-compose 环境变量设置
├─ docker-compose.yml  // docker-compose 配置文件
├─ Dockerfile          // 构建镜像所需的指令和说明
├─ mixins
│ └─ db.mixin.ts      
├─ moleculer.config.ts   // moleculer配置文件
├─ package-lock.json     // 使用 npm i 时生成的文件,用于依赖包版本锁定
├─ package.json          // 项目或者模块包的描述
│─ public                // 公共展示页面信息
│ ├─ favicon.ico
│ ├─ index.html
│ └─ main.css
├─ README.md             // 项目说明
├─ services              // moleculer项目服务代码位置
│ ├─ api.service.ts      // 网关服务
│ └─ redis.service.ts     // 普通服务  
├─ test                  // 单元测试代码位置
│ ├─ integration
│ └─ unit
│ ├─ mixins
│ └─ services
├─ tsconfig.build.json   // 项目构建时 有关ts文件的构建配置
├─ tsconfig.eslint.json  // ts文件代码校验
└─ tsconfig.json         // ts文件代码配置信息

相关链接

  • Moleculer website: https://moleculer.services/
  • Moleculer Documentation: https://moleculer.services/docs/0.14/
  • Moleculer template website:https://github.com/moleculerjs/moleculer-template-project