0.0.5 • Published 12 years ago

node-props v0.0.5

Weekly downloads
4
License
-
Repository
github
Last release
12 years ago

node-props

This package lets application users specify one or more URLs to JSON files containing "application properties." After the files are read and deserialized, a programmer supplied callback is executed. The module provides the function:

props.read( callback );

which reads the command line arguments looking for the string '--config'. The parameter following the config file is a file:, http: or https: URI. You can use multiple --config flags to specify multiple resources. Each resource will be read in order and combined into a single object that is passed to the callback.

I use this feature to separate hardware specific properties from application specific properties. I usually have hardware specific properties (like IP addresses and ports to listen on) in files on the filesystem while application specific properties (names of DB servers, application timeouts, etc.) in http resources on our internal net. This is useful if you're running the same application on several different machines.

Installation

The easiest way to install this package is to use npm:

If you want to check out the source, use the git command:

Usage (for end users)

This package is intended to allow a node application user to do something like this:

and then have the system will pull properties from both the local file and the remote server (example.com), munge them together in the same object and start the main body of the application.

Usage (for developers)

To use the module, simply import the package can call the read() function. Ex:

Tests

There are expresso.js compatible tests in the test directory. Bonus points if you add to the test suite.

License

This package is released under a MIT license, the text of which may be found at https://github.com/OhMeadhbh/node-props/raw/master/LICENSE .

0.0.5

12 years ago

0.0.3

13 years ago

0.0.2

13 years ago

0.0.1

13 years ago