Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 22, 2024 via pnpm

ini 1.3.8

An ini encoder/decoder for node
Package summary
Share
0
issues
1
license
1
ISC
Package created
7 Aug 2011
Version published
11 Dec 2020
Maintainers
6
Total deps
1
Direct deps
0
License
ISC

Issues

0
This package has no issues

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
ini@1.3.8
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of ini 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does ini do?

INI is a powerful npm package for Node.js, utilized as an INI encoder and decoder. INI files are simple text files with a basic structure used in Windows OS for configuration of software applications. The INI parser and serializer offered by this package comes in handy for dealing with this kind of text file. The package provides features to parse INI format text to a conveniently usable JavaScript object and serialize JavaScript objects back to INI format text. It treats sections as nested objects, and the items that appear before the first heading are saved directly onto the object.

How do you use ini?

Using INI for reading, manipulating, and writing an INI file in Node.js is pretty straightforward. Here's a simple JavaScript code usage example:

    var fs = require('fs')
      , ini = require('ini')

    var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))

    config.scope = 'local'
    config.database.database = 'use_another_database'
    config.paths.default.tmpdir = '/tmp'
    delete config.paths.default.datadir
    config.paths.default.array.push('fourth value')

    fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' }))

In this example, it first reads and decodes the INI file called 'config.ini' into a JavaScript object using fs.readFileSync()and ini.parse(). Then it modifies some properties of the JavaScript object. After making the changes, it encodes the object back into an INI-formatted string using ini.stringify() and writes this string into a new file named 'config_modified.ini' with fs.writeFileSync().

Where are the ini docs?

As outlined in the package's Readme, the official documentation for INI is available on its GitHub page (https://github.com/npm/ini). The documentation provides a comprehensive guide and explains how to leverage its API, including methods such as decode, encode, parse, stringify, safe, and unsafe. The API section of the documentation enumerates the purpose and usage of these functions, along with the details of their optional parameters.