
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@mdaemon/ini-file-cache
Advanced tools
A library for reading, writing, and watching ini files for changes
Not applicable to a browser context.
$ npm install @mdaemon/ini-file-cache --save
const IniFileCache = require("@mdaemon/ini-file-cache");
import IniFileCache from "@mdaemon/ini-file-cache";
// Create a new IniFileCache instance
const iniCache = new IniFileCache("/path/to/file/", "config.ini");
// Read a value from the ini file
const value = iniCache.getSetting("section", "key", "defaultValue");
console.log(value);
// Write a value to the ini file
iniCache.setSetting("section", "key", "new value");
// Save changes to the file
iniCache.save();
// Watch for changes in the ini file
iniCache.watch();
// Stop watching the file
iniCache.unwatch();
// Get all sections
const sections = iniCache.getSections();
console.log(sections);
// Get all keys in a section
const keys = iniCache.getKeys("section");
console.log(keys);
// Check if a section exists
const sectionExists = iniCache.hasSection("section");
console.log(sectionExists);
// Check if a key exists in a section
const keyExists = iniCache.hasKey("section", "key");
console.log(keyExists);
// Remove a key from a section
iniCache.removeKey("section", "key");
// Remove an entire section
iniCache.removeSection("section");
// Reload the file from disk
iniCache.reload();
iniCahe.listener.on("change", (filename) => { });
iniCache.listener.on("error", (error) => { });
iniCache.listener.on("reload", (filePath) => { });
iniCache.listener.on("save", (filePath) => { });
Published under the LGPL-2.1 license.
Published by
MDaemon Technologies, Ltd.
Simple Secure Email
https://www.mdaemon.com
FAQs
A library for reading, writing, and watching ini files for changes
We found that @mdaemon/ini-file-cache demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.