Gathering detailed insights and metrics for @wallaceosmar/i18next-electron-fs-backend
Gathering detailed insights and metrics for @wallaceosmar/i18next-electron-fs-backend
Gathering detailed insights and metrics for @wallaceosmar/i18next-electron-fs-backend
Gathering detailed insights and metrics for @wallaceosmar/i18next-electron-fs-backend
A secure fs backend for electron apps
npm install @wallaceosmar/i18next-electron-fs-backend
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
328
Last Day
1
Last Week
7
Last Month
11
Last Year
66
MIT License
17 Stars
55 Commits
13 Forks
2 Watchers
4 Branches
6 Contributors
Updated on May 04, 2025
Minified
Minified + Gzipped
Latest Version
3.0.0
Package Id
@wallaceosmar/i18next-electron-fs-backend@3.0.0
Unpacked Size
16.66 kB
Size
5.99 kB
File Count
7
NPM Version
8.1.2
Node Version
16.13.2
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
133.3%
7
Compared to previous week
Last Month
22.2%
11
Compared to previous month
Last Year
-14.3%
66
Compared to previous year
2
5
npm i @wallaceosmar/i18next-electron-fs-backend
Based on documentation for a i18next config, import the backend.
1import i18n from "i18next"; 2import { 3 initReactI18next 4} from "react-i18next"; 5import backend from "@wallaceosmar/i18next-electron-fs-backend"; 6 7i18n 8 .use(backend) 9 .use(initReactI18next) 10 .init({ 11 backend: { 12 loadPath: "./app/localization/locales/{{lng}}/{{ns}}.json", 13 addPath: "./app/localization/locales/{{lng}}/{{ns}}.missing.json", 14 ipcRenderer: window.api.i18nextElectronBackend // important! 15 }, 16 17 // other options you might configure 18 debug: true, 19 saveMissing: true, 20 saveMissingTo: "current", 21 lng: "en" 22 }); 23 24export default i18n;
1const { 2 contextBridge, 3 ipcRenderer 4} = require("electron"); 5const path = require('path'); 6const backend = require("@wallaceosmar/i18next-electron-fs-backend"); 7 8contextBridge.exposeInMainWorld( 9 "api", { 10 i18nextElectronBackend: backend.preloadBindings(ipcRenderer, process, path) 11 } 12);
In the mainBindings function you have the following parameters:
1const { 2 app, 3 BrowserWindow, 4 session, 5 ipcMain 6} = require("electron"); 7const path = require('path'); 8const backend = require("@wallaceosmar/i18next-electron-fs-backend"); 9const fs = require("fs"); 10 11let win; 12 13async function createWindow() { 14 win = new BrowserWindow({ 15 width: 800, 16 height: 600, 17 webPreferences: { 18 contextIsolation: true, 19 preload: path.join(__dirname, "preload.js") 20 } 21 }); 22 23 const options = { absPath: './' }; 24 backend.mainBindings(ipcMain, win, fs, path, options); // <- configures the backend 25 26 // ... 27} 28 29app.on("ready", createWindow); 30 31app.on("window-all-closed", () => { 32 // On macOS it is common for applications and their menu bar 33 // to stay active until the user quits explicitly with Cmd + Q 34 if (process.platform !== "darwin") { 35 app.quit(); 36 } else { 37 i18nextBackend.clearMainBindings(ipcMain); 38 } 39});
These are options that are configurable, all values below are defaults.
1{ 2 debug: false, // If you'd like to show diagnostic messages 3 loadPath: "/locales/{{lng}}/{{ns}}.json", // Where the translation files get loaded from 4 addPath: "/locales/{{lng}}/{{ns}}.missing.json" // Where the missing translation files get generated 5}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
Found 5/21 approved changesets -- score normalized to 2
Reason
SAST tool is not run on all commits -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More