coresmart / persistencejs

persistence.js is an asynchronous Javascript database mapper library. You can use it in the browser, as well on the server (and you can share data models between them).
http://persistencejs.org
1.72k stars 240 forks source link

export modules #42

Closed defunctzombie closed 13 years ago

defunctzombie commented 13 years ago

The current node example in the readme is invalid (I could not get it to work). Newer versions of node treat modules differently than past versions. This exports the persistence module as well as the store config module for the following use example:

var persistence = require('persistencejs');
var PersistenceConfig = require('persistencejs').StoreConfig;
var siteStore = PersistenceConfig.init(persistence, {
    adaptor: 'mysql',
    ...
});

This patch may need to be expanded upon depending if other files need to be exposed.