🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@alemonjs/db

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alemonjs/db

数据库连接

Source
npmnpm
Version
0.0.14
Version published
Weekly downloads
141
127.42%
Maintainers
2
Weekly downloads
 
Created
Source

https://alemonjs.com/

提供 redis 和 sequelize 连接

import { getIoRedis, getSequelize } from '@alemonjs/db';
// redis
export const Redis = getIoRedis();
// seuqlieze
export const sequelize = getSequelize();

使用说明

yarn add @alemonjs/db -W
  • alemon.config.yaml
db:
  dialect: mysql
  mysql:
    host: '127.0.0.1'
    port: '3306'
    user: 'root'
    password: 'Mysql123456!'
    database: 'alemonjs'
  redis:
    host: '127.0.0.1'
    port: '6379'
    password: ''
    db: '0'
  • use

docker

  • 添加国内镜像

Settings > Docker Engine

{
  "registry-mirrors": ["https://registry.cn-hangzhou.aliyuncs.com"]
}
  • 新增文件 docker-compose.yml
services:
  mysql:
    image: mysql:8.0
    container_name: mysql-container
    environment:
      # 密码 Mm002580!
      # 用户 root
      MYSQL_ROOT_PASSWORD: 'Mysql123456!'
      MYSQL_ROOT_HOST: '%'
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
    ports:
      - '3306:3306'
    command: --default-authentication-plugin=mysql_native_password
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/docker-dbinit.sql
  redis:
    image: redis:6.2-alpine
    container_name: redis-container
    ports:
      - '6379:6379'
  • 新增文件 docker-dbinit.sql
-- 数据库名称:alemonjs
CREATE DATABASE IF NOT EXISTS `alemonjs`
CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci;
  • 启动
docker-compose up -d

Keywords

alemonjs

FAQs

Package last updated on 28 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts