![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@el3um4s/ipc-for-electron-chokidar
Advanced tools
Allow the renderer to use chokidar (Minimal and efficient cross-platform file watching library)
Allow the renderer to use chokidar (Minimal and efficient cross-platform file watching library)
NPM link: @el3um4s/ipc-for-electron-chokidar
Use @el3um4s/ipc-for-electron and @el3um4s/renderer-for-electron-chokidar to allow communication between Electron and a web page
To use the package in a project:
npm i @el3um4s/ipc-for-electron @el3um4s/ipc-for-electron-chokidar @el3um4s/renderer-for-electron-chokidar
Then the preload.ts
file:
import { generateContextBridge } from "@el3um4s/ipc-for-electron";
import chokidar from "@el3um4s/ipc-for-electron-chokidar";
const listAPI = [chokidar];
generateContextBridge(listAPI);
In the renderer file:
import chokidar from "@el3um4s/renderer-for-electron-chokidar";
chokidar.watchFolder({
folderPath: "./documents",
nameWatcher: "customNameWatcher",
apiKey: "my-api-key",
callback: (data) => {
const { path, eventName, nameWatcher } = data;
console.log(data);
},
});
chokidar.on.folderChanged({
apiKey: "my-api-key",
callback: (data) => {
const { path, eventName, nameWatcher } = data;
console.log(data);
},
});
chokidar.watchFile({
filePath: "./documents/demo.txt",
nameWatcher: "customNameWatcher",
});
chokidar.on.fileChanged({
callback: (data) => {
const { path, eventName, nameWatcher } = data;
console.log(data);
},
});
In the renderer you can use:
globalThis.ipc.chokidar.send("watchFolder", {
folderPath: "./documents",
nameWatcher: "customNameWatcher",
});
globalThis.ipc.chokidar.receive("folderChanged", (data) => {
const { path, eventName, nameWatcher } = data;
console.log(data);
});
globalThis.ipc.chokidar.send("watchFile", {
filePath: "./documents/demo.txt",
nameWatcher: "customNameWatcher",
});
globalThis.ipc.chokidar.receive("fileChanged", (data) => {
const { path, eventName, nameWatcher } = data;
console.log(data);
});
watchFolder
- Watch a folder. The response is sent to the folderChanged
channel. The response is a Changed
object.watchFile
- Watch a file. The response is sent to the fileChanged
channel.The response is a Changed
object.watchFolder = async (options: { callback?: (arg0: Changed) => void; apiKey?: string; folderPath: string; nameWatcher: string; }): Promise<Changed>
example:
import chokidar from "@el3um4s/renderer-for-electron-chokidar";
chokidar.watchFolder({
folderPath: "./documents",
nameWatcher: "customNameWatcher",
apiKey: "ipc",
callback: (data) => {
const { path, eventName, nameWatcher } = data;
console.log(data);
},
});
chokidar.watchFolder({
folderPath: "./downloads",
nameWatcher: "customNameWatcher",
});
watchFile = async (options: { callback?: (arg0: Changed) => void; apiKey?: string; folderPath: string; nameWatcher: string; }): Promise<Changed>
example:
import chokidar from "@el3um4s/renderer-for-electron-chokidar";
chokidar.watchFile({
filePath: "./documents/demo.txt",
nameWatcher: "customNameWatcher",
apiKey: "ipc",
callback: (data) => {
const { path, eventName, nameWatcher } = data;
console.log(data);
},
});
chokidar.watchFile({
filePath: "./documents/list.csv",
nameWatcher: "customNameWatcher",
});
on.folderChanged = async (options: { callback?: (arg0: Changed) => void; apiKey?: string; }): Promise<Changed>
example:
import chokidar from "@el3um4s/renderer-for-electron-chokidar";
chokidar.watchFolder({
folderPath: "./downloads",
nameWatcher: "customNameWatcher",
});
chokidar.on.folderChanged({
callback: (data) => {
const { path, eventName, nameWatcher } = data;
console.log(data);
},
});
on.fileChanged = async (options: { callback?: (arg0: Changed) => void; apiKey?: string; }): Promise<Changed>
example:
import chokidar from "@el3um4s/renderer-for-electron-chokidar";
chokidar.watchFile({
filePath: "./documents/list.csv",
nameWatcher: "customNameWatcher",
});
chokidar.on.fileChanged({
callback: (data) => {
const { path, eventName, nameWatcher } = data;
console.log(data);
},
});
Changed
interface Changed {
path: string;
eventName: "add" | "change" | "unlink" | "addDir" | "unlinkDir";
nameWatcher: string;
}
DefaultApiKey
type DefaultApiKey = "ipc";
FAQs
Allow the renderer to use chokidar (Minimal and efficient cross-platform file watching library)
The npm package @el3um4s/ipc-for-electron-chokidar receives a total of 1 weekly downloads. As such, @el3um4s/ipc-for-electron-chokidar popularity was classified as not popular.
We found that @el3um4s/ipc-for-electron-chokidar 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.