
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@fioc/strict
Advanced tools
Type-safe DI for JS/TS with strict compile-time validation — an extension of @fioc/core for robust dependency management.
@fioc/strict is an extension of FIoC (Fluid Inversion Of Control) providing stricter type checking and compile-time validation for dependency injection in TypeScript/JavaScript applications. It enhances @fioc/core by enforcing safety rules to prevent runtime errors and type mismatches.
never.replace or replaceFactory.Unlike
@fioc/core, @fioc/strict focuses solely on compile-time guarantees and validation.
npm install @fioc/core @fioc/strict
# or
yarn add @fioc/core @fioc/strict
# or
pnpm add @fioc/core @fioc/strict
import { buildStrictDIContainer } from "@fioc/strict";
import { createDIToken } from "@fioc/core";
interface ApiService {
getData: () => string;
}
const ApiServiceToken = createDIToken<ApiService>().as("ApiService");
const HttpApiService: ApiService = { getData: () => "Hello, World!" };
const container = buildStrictDIContainer()
.register(ApiServiceToken, HttpApiService)
.getResult();
const apiService = container.resolve(ApiServiceToken); // Type `never` if not registered
apiService.getData(); // "Hello, World!"
import { buildStrictDIContainer } from "@fioc/strict";
import { createDIToken } from "@fioc/core";
export const getDataUseCaseToken =
createDIToken<() => string>().as("getDataUseCase");
const getDataUseCaseFactory = (apiService: ApiService) => () =>
apiService.getData();
const container = buildStrictDIContainer()
.register(ApiServiceToken, HttpApiService)
.registerFactory(getDataUseCaseToken, {
// Type error if the token is already registered
dependencies: [ApiServiceToken], // Type error if not registered
factory: getDataUseCaseFactory,
})
.getResult();
const useCase = container.resolve(getDataUseCaseToken); // Type `never` if not registered
useCase();
const newImplementation: ApiService = { getData: () => "New Data!" };
const container = buildStrictDIContainer()
.register(ApiServiceToken, HttpApiService)
.replace(ApiServiceToken, newImplementation) // Won't give type error
.replaceFactory(getDataUseCaseToken, {
dependencies: [ApiServiceToken],
factory: getDataUseCaseFactory,
})
.getResult();
Open issues or submit pull requests on GitHub. Include tests for behavioral changes.
MIT License. See LICENSE.
FAQs
Type-safe DI for JS/TS with strict compile-time validation — an extension of @fioc/core for robust dependency management.
We found that @fioc/strict demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.