🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@eggjs/utils

Package Overview
Dependencies
Maintainers
9
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eggjs/utils

Utils for all egg projects

Source
npmnpm
Version
5.0.2-beta.12
Version published
Weekly downloads
25K
19.51%
Maintainers
9
Weekly downloads
 
Created
Source

@eggjs/utils

NPM version npm download Node.js Version

Utils for all egg projects.

Installation

npm i @eggjs/utils

API

getPlugins(options)

  • {String} baseDir - the current directory of application
  • {String} framework - the directory of framework
  • {String} env - egg environment

getLoadUnits(options)

  • {String} baseDir - the current directory of application
  • {String} framework - the directory of framework
  • {String} env - egg environment

getConfig(options)

  • {String} baseDir - the current directory of application
  • {String} framework - the directory of framework
  • {String} env - egg environment

getFrameworkPath(options)

  • {String} baseDir - the current directory of application
  • {String} framework - the directory of framework

setBundleModuleLoader(loader)

Register a module loader hook for bundled Egg apps. The hook runs before the normal importModule() resolution path.

  • {Function | undefined} loader - a synchronous function that receives the original filepath argument passed to importModule() after POSIX separator normalization, or a virtual specifier. It does not receive the resolved absolute file path from importResolve(). Return undefined to fall back to the normal import path.

The bundle loader is stored on globalThis, so bundled and external copies of @eggjs/utils share the same loader. Non-undefined results follow the same default export unwrapping rules as importModule(), including importDefaultOnly.

License

MIT

Contributors

Contributors

Made with contributors-img.

Keywords

egg

FAQs

Package last updated on 23 Jun 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