
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.
fusion-tokens
Advanced tools
Dependency injection tokens for Fusion.js.
Fusion.js dependency injection is based on tokens rather than strings. This avoids naming collision issues. This package provides utilities to create named tokens, as well as common tokens that are used by packages maintained by the Fusion.js team.
yarn add fusion-tokens
FetchToken
import {FetchToken} from 'fusion-tokens';
A token for a fetch implementation.
type Fetch = (input: string, options: Object) => Promise<Response>
Typically, fetch
or a polyfill such as unfetch.
LoggerToken
import {LoggerToken} from 'fusion-tokens';
A token for a logger implementation.
type Logger = {
log(level: string, arg: any): void,
error(arg: any): void,
warn(arg: any): void,
info(arg: any): void,
verbose(arg: any): void,
debug(arg: any): void,
silly(arg: any): void,
}
Typically, console
or a logger library such as Winston.
SessionToken
import {SessionToken} from 'fusion-tokens';
A token for a session implementation.
type Session = {
from(ctx: Context): {
get(key: string): any,
set(key: string, val: any): void,
},
}
Typically, the service provided by fusion-plugin-jwt
or a custom wrapper around similar key-value store APIs (such as Redis).
CacheToken
import {CacheToken} from 'fusion-tokens';
A token for a caching implementation.
type Cache = {
get(key: string): Promise<mixed>,
set(key: string, val: any): Promise<mixed>,
del(key: string): Promise<mixed>,
}
Standard API for caching.
FAQs
Dependency injection tokens for FusionJS
The npm package fusion-tokens receives a total of 145 weekly downloads. As such, fusion-tokens popularity was classified as not popular.
We found that fusion-tokens demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.