{"library":"properties","title":".properties Parser and Stringifier","description":"The `properties` package provides a comprehensive parser and stringifier for Java-style `.properties` files, including support for extended features such as INI-like sections, variable expansion (including references to environment variables), dot-separated namespaces, and file import directives. The current stable version is 1.2.1. Although the README once implied active development, the package's last update was over nine years ago, and its `engines.node` requirement (>=0.10) indicates it targets very old Node.js environments, suggesting it is now abandoned. It distinguishes itself by not only adhering to the core Java `.properties` specification but also by offering powerful, opt-in enhancements that allow for highly structured and dynamic configuration management, going beyond basic key-value pair parsing.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install properties"],"cli":null},"imports":["const properties = require('properties');","const properties = require('properties');\nproperties.parse(data, options, callback);","const properties = require('properties');\nproperties.stringify(obj, options, callback);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const properties = require('properties');\nconst fs = require('fs');\nconst path = require('path');\n\nconst filePath = path.join(__dirname, 'config.properties');\nconst fileContent = `# Application Configuration\napp_name = MyWebApp\n\n[web]\nhostname = 127.0.0.1\nport = 3000\n\n[db]\nhostname = localhost\nport = 5432\nuser = admin\n`;\n\n// Create a dummy config file for parsing\nfs.writeFileSync(filePath, fileContent);\n\nproperties.parse(filePath, { path: true, sections: true, variables: true }, function (error, obj) {\n  if (error) {\n    console.error('Error parsing properties:', error);\n    return;\n  }\n  console.log('Parsed Configuration:');\n  console.log(obj);\n  // Expected output will include nested objects for sections\n  // { app_name: 'MyWebApp', web: { hostname: '127.0.0.1', port: 3000 }, db: { hostname: 'localhost', port: 5432, user: 'admin' } }\n  \n  // Clean up the dummy file\n  fs.unlinkSync(filePath);\n});","lang":"javascript","description":"Demonstrates parsing a `.properties` file from a file path, including support for INI-style sections and logging the resulting JavaScript object.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}