![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@financial-times/dotcom-server-app-context
Advanced tools
This package provides tools to define FT app context data and a [JSON schema] definition to validate it with. It is used to define and distribute useful information to other components including ads and tracking.
This package provides tools to define FT app context data and a JSON schema definition to validate it with. It is used to define and distribute useful information to other components including ads and tracking.
To learn more about why this feature exists please review the design document. To find out which properties can be defined please refer to the app context schema.
If you want to share application specific data with the client, consider using @financial-times/dotcom-ui-data-embed.
This package is compatible with Node 12+ and is distributed on npm.
npm install -S @financial-times/dotcom-server-app-context
This package provides a single class which can be configured using options:
import { AppContext } from '@financial-times/dotcom-server-app-context'
const appContext = new AppContext()
The app context instance provides methods to get and set app context data:
appContext.set('appName', 'my-application')
const property = appContext.get('appName') // "my-application"
const contextData = appContext.getAll() // { appName: "my-application" }
get(property: string): any
Returns the value of the requested property.
set(property: string, value: any)
Sets the value of the specified property. The provided value will be validated against the app context schema. If the value is invalid this method will throw an error.
getAll(): object
Returns an immutable copy of the app context data.
The AppContext
class accepts the following parameters. All parameters are optional:
appContext
An app context data object, see the app context schema for more information. Defaults to {}
.
FAQs
This package provides tools to define FT app context data and a [JSON schema] definition to validate it with. It is used to define and distribute useful information to other components including ads and tracking.
The npm package @financial-times/dotcom-server-app-context receives a total of 886 weekly downloads. As such, @financial-times/dotcom-server-app-context popularity was classified as not popular.
We found that @financial-times/dotcom-server-app-context 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.