Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
i18next-prisma-backend
Advanced tools
A backend plugin for i18next that supports using Prisma to load resources from the data source specified in the schema.prisma
configuration file.
This package expects the Prisma Client as a peer dependency.
npm
npm install @prisma/client i18next-prisma-backend
yarn
yarn add @prisma/client i18next-prisma-backend
Update your schema.prisma
files to include the following model with a minimum of the following fields:
model i18n {
namespace String
language String
key String
translation String
@@id([key, language])
@@index([language, translation])
}
You may use @@map
and @map
to specify the underlying database table and field names respectively. The plugin will expect this model to exist.
Apply the schema changes to your database.
This library supports ESM and CommonJS.
ESM
import i18next from "i18next";
import Backend from "i18next-prisma-backend";
i18next.use(Backend).init({
// Backend Options
backend: options
});
CommonJS
const i18next = require("i18next");
const Backend = require("i18next-prisma-backend");
i18next.use(Backend).init({
// Backend Options
backend: options
});
{
// Optional: If you have an existing client instance,
// you can specifiy it here. Otherwise a new instance
// will be instanciated.
client: prisma; // PrismaClient() instance
}
Copyright © 2023 Aydrian Howard.
This project is MIT licensed.
FAQs
Use i18next with Prisma ORM as backend
The npm package i18next-prisma-backend receives a total of 6 weekly downloads. As such, i18next-prisma-backend popularity was classified as not popular.
We found that i18next-prisma-backend 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.