@7365admin1/node-server-utils

中文文档
1.6.1发布于 2026/10/01MITTypeScriptESM + CJS近 30 天下载 2753

This project utilizes environment variables for configuration. Below is a list of variables you need to set either in a .env file or in your environment:

原始使用文档

Project Environment Configuration

This project utilizes environment variables for configuration. Below is a list of variables you need to set either in a .env file or in your environment:

  • MONGO_URI: MongoDB connection URI.
  • MONGO_DB: MongoDB database name for production.
  • MONGO_DB_DEV: MongoDB database name for development.
  • PORT: Port number the server should listen on.
  • SECRET_KEY: Secret key for cryptographic operations.
  • isDev: Boolean indicating if the environment is development (true) or production (false).
  • MAILER_TRANSPORT_HOST: Hostname for mailer transport (e.g., SMTP server).
  • MAILER_TRANSPORT_PORT: Port number for mailer transport.
  • MAILER_TRANSPORT_SECURE: Boolean indicating if the mailer transport should use secure connection (true or false).
  • MAILER_EMAIL: Email address for sending emails.
  • MAILER_PASSWORD: Password for the email account.
  • ACCESS_TOKEN_SECRET: Secret key for JWT access tokens.
  • REFRESH_TOKEN_SECRET: Secret key for JWT refresh tokens.
  • ACCESS_TOKEN_EXPIRY: Expiry time for JWT access tokens.
  • REDIS_HOST: Hostname for Redis server.
  • REDIS_PORT: Port number for Redis server.
  • REDIS_PASSWORD: Password for Redis server (if applicable).

Setting Up

  1. Clone the repository and navigate to the project directory.
  2. Create a .env file in the root directory.
  3. Copy the variables from this document into your .env file and set appropriate values.
MONGO_URI=mongodb://localhost:27017
MONGO_DB=default
MONGO_DB_DEV=default-dev
PORT=3001
SECRET_KEY=your_secret_key_here
MAILER_TRANSPORT_HOST=smtp.example.com
MAILER_TRANSPORT_PORT=465
MAILER_TRANSPORT_SECURE=true
[email protected]
MAILER_PASSWORD=your_email_password
ACCESS_TOKEN_SECRET=your_access_token_secret
REFRESH_TOKEN_SECRET=your_refresh_token_secret
ACCESS_TOKEN_EXPIRY=1d
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password
  1. Save the .env file.

Notes

  • Ensure all environment variables are correctly set before starting the application.
  • For development, consider using tools like dotenv to load environment variables from a .env file automatically.

版本与发布记录

@7365admin1/node-server-utils 共发布 10 个版本,首次发布于 2026/01/20;过去 12 个月发布了 10 个版本。

版本发布日期距今
1.6.1latest2026/10/011 个月前
1.6.02026/07/213 个月前
1.5.1-staging.1staging2026/07/213 个月前
1.5.02026/07/064 个月前
1.4.02026/04/286 个月前
1.3.02026/03/177 个月前

关于 @7365admin1/node-server-utils 的常见问题

@7365admin1/node-server-utils 是什么?

This project utilizes environment variables for configuration. Below is a list of variables you need to set either in a .env file or in your environment:

如何安装 @7365admin1/node-server-utils?

在项目目录运行 npm install @7365admin1/node-server-utils,或使用 pnpm add / yarn add / bun add。

@7365admin1/node-server-utils 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@7365admin1/node-server-utils 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@7365admin1/node-server-utils 可以商用吗?

@7365admin1/node-server-utils 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@7365admin1/node-server-utils 的下载量有多少?

根据 npm 官方下载统计,@7365admin1/node-server-utils 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,753 次,日均约 92 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@7365admin1/node-server-utils 还在维护吗?

最新版本 1.6.1 发布于 2026/10/01(1 个月前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/01/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。