JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 698441
  • Score
    100M100P100Q190877F

A Java .properties file parser ported to node.js.

Package Exports

  • properties

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (properties) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Node Properties

A Java .properties file parser ported to node.js

Show me! | Availability | Compatibility | Documentation

Version: 0.1.14

If you need advanced features like arguments replacement, INI sections and property expansion (keys as variables) take a look at Node-EnhancedProperties.

Show me!

var Properties = require ("properties");

new Properties ()
    .set ("p1", "v1", "Property 1")
    .set ("p2", null, "Property 2, empty")
    .set ("p3", "v3")
    .set ("p4", null)
    .store ("example.properties", "Example .properties file", function (error){
        new Properties ().load ("example.properties", function (error){
            var me = this;
            var keys = this.keys ();
            
            console.log ("keys: " + keys); //Prints: keys: p1,p2,p3,p4
            
            keys.forEach (function (key){
                console.log (key + ": " + me.get (key));
            });
            /*
            Prints: 
            
            p1: v1
            p2: null
            p3: v3
            p4: null
            */
        });
    });

example.properties:

#Example .properties file
#Property 1
p1=v1
#Property 2, empty
p2=
p3=v3
p4=

Availability

Via npm:

npm install properties

Compatibility

✔ Node 0.4.10+


Documentation

Reference
Examples
Change Log
MIT License