Socket
Socket
Sign inDemoInstall

avvio

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avvio - npm Package Compare versions

Comparing version 6.3.0 to 6.3.1

9

boot.js

@@ -147,3 +147,8 @@ 'use strict'

debug('root plugin ready')
this.emit('preReady')
try {
this.emit('preReady')
} catch (prereadyError) {
err = err || this._error || prereadyError
}
if (err) {

@@ -156,4 +161,4 @@ this._error = err

this.booted = true
this._readyQ.resume()
}
this._readyQ.resume()
})

@@ -160,0 +165,0 @@ }

{
"name": "avvio",
"version": "6.3.0",
"version": "6.3.1",
"description": "Asynchronous bootstrapping of Node applications",

@@ -8,3 +8,3 @@ "main": "boot.js",

"typescript": "tsc --project ./test/types/tsconfig.json",
"test": "standard && tap -j4 test/*test.js && npm run typescript"
"test": "standard && tap --no-esm -j4 test/*test.js && npm run typescript"
},

@@ -11,0 +11,0 @@ "precommit": "test",

@@ -321,1 +321,40 @@ 'use strict'

})
test('preReady errors must be managed', (t) => {
t.plan(2)
const app = boot()
app.use((f, opts, cb) => {
cb()
})
app.on('preReady', () => {
throw new Error('boom')
})
app.ready(err => {
t.pass('ready function is called')
t.equal(err.message, 'boom')
})
})
test('preReady errors do not override plugin\'s errors', (t) => {
t.plan(3)
const app = boot()
app.use((f, opts, cb) => {
cb(new Error('baam'))
})
app.on('preReady', () => {
t.pass('preReady is executed')
throw new Error('boom')
})
app.ready(err => {
t.pass('ready function is called')
t.equal(err.message, 'baam')
})
})

@@ -10,3 +10,5 @@ 'use strict'

} else {
import('./esm.mjs').catch((err) => {
// Import is not allowed syntax in Node 8
// eslint-disable-next-line
new Function('module', 'return import(module)')('./esm.mjs').catch((err) => {
process.nextTick(() => {

@@ -13,0 +15,0 @@ throw err

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