Socket
Socket
Sign inDemoInstall

egg-core

Package Overview
Dependencies
Maintainers
14
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-core - npm Package Compare versions

Comparing version 5.3.1 to 5.4.0

CHANGELOG.md

12

lib/egg.js
const assert = require('assert');
const { AsyncLocalStorage } = require('async_hooks');
const fs = require('fs');

@@ -18,2 +19,3 @@ const KoaApplication = require('koa');

const CLOSE_PROMISE = Symbol('EggCore#closePromise');
const EGG_CTX_STORAGE = Symbol.for('egg#ctxStorage');

@@ -39,5 +41,9 @@ class EggCore extends KoaApplication {

// enable asyncLocalStorage by default
// https://github.com/koajs/koa/pull/1721
super({ asyncLocalStorage: true });
// disable koa als and use egg logic
super({ asyncLocalStorage: false });
// can access the AsyncLocalStorage instance in global
if (!global[EGG_CTX_STORAGE]) {
global[EGG_CTX_STORAGE] = new AsyncLocalStorage();
}
this.ctxStorage = global[EGG_CTX_STORAGE];

@@ -44,0 +50,0 @@ this.timing = new Timing();

{
"name": "egg-core",
"version": "5.3.1",
"version": "5.4.0",
"publishConfig": {
"tag": "latest-5"
},
"description": "A core Pluggable framework based on koa",

@@ -5,0 +8,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc