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

@madbean/services

v1.0.0

Published

micro services

Downloads

14

Readme

Micro Services Help.

Lerna

Lerna is a monorepo manager

  • /
    • packages.json
    • lerna.json
    • /packages
      • some_module
        • package.json
        • /src
          • index.js
          • /test x.test.js
        • node_modules
      • ...

Init lerna repo

# in the git repo.
npm i -g lerna
# independent make each repo version independent.
# so only updated packages will be bumped.
lerna init --independent

how to init this repo

# git clone the repo then cd service/
npm install

# bootstrap :
# npm install all external dependencies of each package.
# Symlink together all Lerna packages that are dependencies of each other.
# npm prepublish all bootstrapped packages.
lerna bootstrap

run a service

# go to the package of your choice
cd packages/users/

# then in dev mode run
npm run dev

# go to
http://localhost:3000/

# if you make some modification and save the file the server will auto restart
# stop it
Ctrl + C

# run tests
npm run test

Publish package lerna manualy /!\ don't do this if you don't know what you are doing !

# publish
lerna publish --cd-version patch --yes --registry=http://nexus.madbean.ovh/repository/npm/ --scoped @madbean

Install a packages in another project

# install package
npm login --registry http://nexus.madbean.ovh/repository/npm-group/
npm --registry http://nexus.madbean.ovh/repository/npm-group/ install @madbean/[email protected]

Lib

  • https://github.com/pedronauck/micro-router

ESLint

Plugins

  • eslint
    • eslint-config-standard
  • eslint-plugin-import
  • eslint-plugin-node
  • eslint-plugin-async
    • .eslintrc
  • eslint-plugin-promise
  • eslint-plugin-standard
  • eslint-plugin-react
    • eslint-config-standard-react

Bash

split var

tab=$(lerna updated --json)
elem=$(echo "$tab" | jq '.[0] .name')
part=(${elem//@madbean\//})
echo "${part}"

rancher

#image api service
image: cdrx/rancher-gitlab-deploy

rancher compose

version: "2"

services:
  rancher-server:
    depends_on:
      - mysql
    restart: always
    image: rancher/server:v1.6.7
    ports:
      - "8099:8080"
    container_name: rancher
    links:
      - mysql:mysql
    environment:
      CATTLE_DB_CATTLE_MYSQL_HOST: mysql
      CATTLE_DB_CATTLE_MYSQL_PORT: 3306
      CATTLE_DB_CATTLE_PASSWORD: 3v0ll1SSSG
      CATTLE_DB_CATTLE_USERNAME: cattle
      CATTLE_DB_CATTLE_MYSQL_NAME: cattle

  mysql:
    restart: always
    image: mysql/mysql-server:5.7
    ports:
      - "3306"
    container_name: mysql-rancher
    volumes:
      - /data/docker/volumes/rancher/mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: 3v0ll1SSSG
      MYSQL_DATABASE: cattle
      MYSQL_USER: cattle
      MYSQL_PASSWORD: 3v0ll1SSSG

token

//nexus.madbean.ovh/repository/npm/:_authToken=aa1c8e64-b825-3e62-b192-f8ce2829906b

socket.io and pub sub

  • auth
  • session
  • on socket.io connect register soket.id by user in users{}
  • redis pub sub
  • on redis recive socket.io emit
  • react revcive and dispatch