![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@alterior/http
Advanced tools
🚀 3.0.0-rc.5
@alterior/express
and @alterior/fastify
. As part of this,
you must now import @alterior/express
or @alterior/fastify
and specify it as the web server engine from this
version on. For example:
// main.ts
import { WebServerEngine } from '@alterior/web-server';
import { ExpressEngine } from '@alterior/express';
WebServerEngine.default = ExpressEngine;
Alternatively you can specify an engine via dependency injection:
@WebService({
providers: [
{ provide: WebServerEngine, useClass: ExpressEngine }
]
})
export class MyService {
// ...
}
This change reduces the complexity of Alterior's dependency tree by ensuring that excess web server dependencies
will not be present (ie fastify on an express app or express on a fastify app). It also fixes an issue where Alterior
users were required to install a lot of Express-related @types/*
packages to avoid Typescript errors during
development.@/annotations
@NgMetadataName()
and related Angular compatibility features have been entirely removed. They do not work with
newer versions of Angular. The recommended way to use Alterior with Angular is via @alterior/platform-angular
@/runtime
--self-test
option no longer starts the application (so the OnStart
lifecycle method does not execute)@/web-server
boolean
values on input parameters (ie @QueryParam()
) when a parameter annotated with boolean
type is used. The values ''
, 'no'
, '0'
, 'false'
, and 'off'
produce false
, all other values produce true
.Date
values on input parameters (ie @QueryParam
et al) when a parameter annotated with Date
type is used. Any string value that produces a valid Date
object via new Date(str)
will be accepted, otherwise a
400 Bad Request
will be returned without executing the route method. Caution: Because this accepts values in milliseconds (not seconds), it is not suitable for receiving UNIX timestamps.X-Trace
or so). Not enabled by
default. Use requestIdHeader
option when configuring the web server to enable this functionality.engine
option from WebServerOptions
. Either set WebServerEngine.default
or provide
WebServerEngine
as a dependency to specify the web engine. See above for details.@QueryParam()
no longer requires the name
parameter. Similar to the offer input decorators, @QueryParam()
already supported auto-detecting name
, this just adjusts the function signature to match the behavior.CertificateGenerator
is now properly exported for external use204 No Content
, provided the headers have not already
been sent, and the status code selected by the end of the request is 200 OK
. If you need to return an empty body
with status 200 OK
instead of 204 No Content
, call WebEvent.response.end()
before completing the request.FAQs
Flexible and configurable HTTP client
The npm package @alterior/http receives a total of 14 weekly downloads. As such, @alterior/http popularity was classified as not popular.
We found that @alterior/http demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.