
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
pico-di-remix-express
Advanced tools
_ _ _
_ __ (_) ___ ___ __| (_)
| '_ \| |/ __/ _ \ _____ / _` | |
| |_) | | (_| (_) |_____| (_| | |
| .__/|_|\___\___/ \__,_|_| + Remix + express
|_|
Adapter for using pico-di with Remix + express.
pico-di を Remix + express 環境で使うためのアダプタです。
pico-di-remix-express には pico-di に加えて以下の機能があります:
Remix + express (@remix-run/express) に対応しています。
Node.js
npm から入手できます。インストールするには:
$ npm install pico-di-remix-express
サービスは全て ~/services ディレクトリ以下にまとめ、~/services/index.ts でそれぞれインポートします。プロバイダ作成関数をエクスポートする必要があります。
// /app/services/index.ts
import { createGetProvider } from "pico-di-remix-express";
import Service1 from "./Service1";
import Service2 from "./Service2";
import Service3 from "./Service3";
type Context = {
service1: Service1,
service2: Service2,
service3: Service3,
};
// `getProvider` という名前にしておきます。
const getProvider = createGetProvider<Context>(builder => builder
.addSingleton("service1", Service1)
.addScoped("service2", Service2)
.addTransient("service3", Service3));
export {
getProvider,
type Context,
type Service1,
type Service2,
type Service3,
}
/app/entry.server.tsx の修正先ほどの getProvider という関数を ~/entry.server.tsx からエクスポートする必要があります。このエクスポートは pico-di-remix-express がサービスプロバイダを取得するために必要です。
// /app/entry.server.tsx
export { getProvider } from "~/services";
// ...
/server.js の修正import { type LoaderArgs, type ActionArgs } from "pico-di-remix-express";
import { type Context } from "~/services";
export const loader = ({
context: {
service1,
service2,
service3,
},
}: LoaderArgs<Context>) => {
// ...
};
export const action = ({
context: {
service1,
service2,
service3,
},
}: ActionArgs<Context>) => {
// ...
};
FAQs
Adapter for using pico-di with Remix + express.
We found that pico-di-remix-express 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
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.