Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
.properties parser/stringifier.
JavaScript
tree: 8ff268f1bc

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
build
examples
src
test
.gitignore
LICENSE
Properties specification
README.md

README.md

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

Something went wrong with that request. Please try again.