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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dltechnology/devops-toolkit

v0.0.0-2f418fe

Published

DevOps toolkit for Dinglan asset server operations

Readme

🛠️ DevOps Toolkit

NPM Version NPM Downloads

一个极简的 DevOps 工具包,专注于核心功能:Docker 镜像构建、数据同步和 Seed 脚本执行。

✨ 核心特性

  • 🐳 Docker 镜像构建 - 自动化容器镜像构建和推送
  • 📊 数据同步 - 数据库间的数据同步
  • 🌱 Seed 脚本 - 数据库初始化和批量处理

📦 安装

# 全局安装
npm install -g @dinglantechnology/devops-toolkit

# 项目依赖
npm install @dinglantechnology/devops-toolkit

⚡ 快速开始

CLI 使用

# Docker 镜像构建
devops build image -t my-app:latest --push

# 数据同步
devops data-sync sync local dev

# 运行 Seed 脚本
devops seed ./scripts/seed.js --env dev

编程接口

import { buildImage, syncData, runSeed } from '@dinglantechnology/devops-toolkit'

// 构建镜像
const buildResult = await buildImage({
  tag: 'my-app:latest',
  push: true,
  onProgress: (msg) => console.log(`构建: ${msg}`),
})

// 数据同步
await syncData({
  source: 'local',
  target: 'dev',
  onProgress: (msg) => console.log(msg),
})

// 获取数据库 URL
const databaseUrl = getDatabaseUrl('dev')
console.log('数据库连接:', databaseUrl)

📚 命令参考

Build 命令

# 构建 Docker 镜像
devops build image [options]

选项:
  -t, --tag <tag>          镜像标签
  -p, --push               构建后推送镜像
  --skip-push              跳过推送镜像
  --platform <platform>    目标平台 (默认: linux/amd64)
  -d, --dry-run            预览模式,不执行实际操作
  -v, --verbose            启用详细日志输出

Data Sync 命令

# 同步数据库数据
devops data-sync sync <source> <target> [options]

参数:
  source                   源环境 (local | dev | sit | uat | prod)
  target                   目标环境 (local | dev | sit | uat | prod)

选项:
  -d, --dry-run            预览模式,不执行实际操作
  -v, --verbose            启用详细日志输出

Seed 命令

# 运行 Seed 脚本
devops seed <seedFile> [options]

参数:
  seedFile                 Seed 脚本文件路径

选项:
  -e, --env <environment>  目标环境 (local | dev | sit | uat | prod) [默认: local]

⚙️ 配置

环境变量

# 数据库连接
export DATABASE_URL_LOCAL="postgresql://localhost:5432/local_db"
export DATABASE_URL_DEV="postgresql://dev.example.com:5432/dev_db"
export DATABASE_URL_SIT="postgresql://sit.example.com:5432/sit_db"
export DATABASE_URL_UAT="postgresql://uat.example.com:5432/uat_db"
export DATABASE_URL_PROD="postgresql://prod.example.com:5432/prod_db"

# Docker 配置
export DOCKER_REGISTRY="registry.example.com"
export DOCKER_NAMESPACE="your-namespace"
export DOCKER_APP="your-app"

Seed 脚本示例

// scripts/seed.js
module.exports = async function (databaseUrl, environment) {
  // 在这里使用数据库 URL 进行数据初始化
  console.log(`正在初始化 ${environment} 环境的数据...`)
  console.log(`数据库连接: ${databaseUrl}`)

  // 示例:使用任何数据库客户端
  // const client = new DatabaseClient(databaseUrl)
  // await client.connect()
  // await client.insertUsers([
  //   { email: '[email protected]', name: 'Admin' },
  //   { email: '[email protected]', name: 'User' }
  // ])
  // await client.disconnect()

  console.log('数据初始化完成')
}

📄 许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件

🔗 相关资源


如有问题或建议,欢迎提交 Issue 或联系维护团队。