Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 87 lines (63 sloc) 1.836 kb
8dff99f @gagle v0.1.8
authored
1 <a name="start"></a>
2
3 Node Properties
4 ===============
5
e772ecc @gagle updated readme
authored
6 _Node.js project_
7
b98608f @gagle updated readme
authored
8 #### A Java .properties file parser ported to node.js ####
8dff99f @gagle v0.1.8
authored
9
688dca8 @gagle updated readme
authored
10 [Show me!](#showme) | [Availability](#availability) | [Compatibility](#compatibility) | [Documentation](#documentation)
8dff99f @gagle v0.1.8
authored
11
8ff268f @gagle v0.1.14
authored
12 Version: 0.1.14
8dff99f @gagle v0.1.8
authored
13
8a6c740 @gagle updated readme
authored
14 If you need advanced features like arguments replacement, INI sections and property expansion (keys as variables) take a look at [Node-EnhancedProperties](https://github.com/Gagle/Node-EnhancedProperties).
15
688dca8 @gagle updated readme
authored
16 <a name="showme"></a>
17 #### Show me! [](#start) ####
18
19 ```javascript
20 var Properties = require ("properties");
21
22 new Properties ()
23 .set ("p1", "v1", "Property 1")
24 .set ("p2", null, "Property 2, empty")
25 .set ("p3", "v3")
26 .set ("p4", null)
27 .store ("example.properties", "Example .properties file", function (error){
28 new Properties ().load ("example.properties", function (error){
29 var me = this;
30 var keys = this.keys ();
5eb4cfd @gagle updated readme
authored
31
688dca8 @gagle updated readme
authored
32 console.log ("keys: " + keys); //Prints: keys: p1,p2,p3,p4
5eb4cfd @gagle updated readme
authored
33
688dca8 @gagle updated readme
authored
34 keys.forEach (function (key){
4a3829e @gagle updated docs
authored
35 console.log (key + ": " + me.get (key));
688dca8 @gagle updated readme
authored
36 });
37 /*
38 Prints:
5eb4cfd @gagle updated readme
authored
39
4a3829e @gagle updated docs
authored
40 p1: v1
41 p2: null
42 p3: v3
43 p4: null
688dca8 @gagle updated readme
authored
44 */
45 });
46 });
47 ```
48
49 example.properties:
50
51 ```text
52 #Example .properties file
53 #Property 1
54 p1=v1
55 #Property 2, empty
56 p2=
57 p3=v3
58 p4=
59 ```
60
61 ***
62
8dff99f @gagle v0.1.8
authored
63 <a name="availability"></a>
64 #### Availability [](#start) ####
65
66 Via npm:
67
68 ```
69 npm install properties
70 ```
71
72 ***
73
74 <a name="compatibility"></a>
75 #### Compatibility [](#start) ####
76
1771ed3 @gagle updated readme
authored
77 ✔ Node 0.4.10+
8dff99f @gagle v0.1.8
authored
78
79 ***
80
81 <a name="documentation"></a>
82 #### Documentation [](#start) ####
83
84 [Reference](https://github.com/Gagle/Node-Properties/wiki/Reference)
85 [Examples](https://github.com/Gagle/Node-Properties/tree/master/examples)
86 [Change Log](https://github.com/Gagle/Node-Properties/wiki/Change-Log)
87 [MIT License](https://github.com/Gagle/Node-Properties/blob/master/LICENSE)
Something went wrong with that request. Please try again.