{"_id":"archives","_rev":"4-969ebf8c0fdecc3a8e120e6bba516ee5","name":"archives","description":"MongoDB transactional wrapper for Node.js applications.","dist-tags":{"latest":"0.0.1"},"versions":{"1.0.0":{"name":"archives","version":"1.0.0","description":"MongoDB transactional wrapper for Node.js applications.","main":"index.js","directories":{"test":"tests"},"scripts":{"test":"node ./tests/archives.spec.js"},"repository":{"type":"git","url":"https://github.com/ktstowell/archives.git"},"keywords":["npm","mongodb"],"author":{"name":"Ken Stowell"},"license":"ISC","bugs":{"url":"https://github.com/ktstowell/archives/issues"},"homepage":"https://github.com/ktstowell/archives","devDependencies":{"assert":"^1.3.0","chalk":"^1.0.0","mongodb":"^2.0.27","q":"^1.2.0","vows":"^0.8.1"},"gitHead":"9c0a389092f961aebfe9a15ce2eb9d6406ac1156","_id":"archives@1.0.0","_shasum":"25ccfc99cce41d8eae87256f0e06b6ce486837a3","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.1","_npmUser":{"name":"ktstowell","email":"stowell.kt@gmail.com"},"dist":{"shasum":"25ccfc99cce41d8eae87256f0e06b6ce486837a3","tarball":"https://registry.npmjs.org/archives/-/archives-1.0.0.tgz","integrity":"sha512-DBy0nhFn3jPY/etbgODjNlU6LDCLILi3T0lO/SRQSDlGeFENgCHa9npuT9uQeJkrhLGc0Q0j+nKEXTTqAPO6Zw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLQxTNUyrIHuMT9FtQFuSJukb3IqrF5rzMrovSK9FA7AIhAJH1/Awv0rML9zNTSsvcIC0IOS9p3wQ39w7W8hNCspDJ"}]},"maintainers":[{"name":"ktstowell","email":"stowell.kt@gmail.com"}]},"0.0.1":{"name":"archives","version":"0.0.1","description":"MongoDB transactional wrapper for Node.js applications.","main":"index.js","directories":{"test":"tests"},"scripts":{"test":"node ./tests/archives.spec.js"},"repository":{"type":"git","url":"https://github.com/ktstowell/archives.git"},"keywords":["npm","mongodb"],"author":{"name":"Ken Stowell"},"license":"ISC","bugs":{"url":"https://github.com/ktstowell/archives/issues"},"homepage":"https://github.com/ktstowell/archives","devDependencies":{"assert":"^1.3.0","chalk":"^1.0.0","mongodb":"^2.0.27","q":"^1.2.0","vows":"^0.8.1"},"gitHead":"956d382ac715d2755b648b09a76d871fff4f62f2","_id":"archives@0.0.1","_shasum":"84684249bf6a252a9a5acf702df0129006fe5d15","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"ktstowell","email":"stowell.kt@gmail.com"},"dist":{"shasum":"84684249bf6a252a9a5acf702df0129006fe5d15","tarball":"https://registry.npmjs.org/archives/-/archives-0.0.1.tgz","integrity":"sha512-0VRJJ2GzcLbpnAH2g3kklYt5n2hX1bE2Z8ZVxtYUV5w514ClwuhHKx3trKVPs7AN4qO+ZRob7XJjtLA0JAz/Ag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5rc9OjCbScvhS3R2dvQPRU5HgqCsgluQ2RNzMy5orsQIgK/hRdJ5B39cxGERE72azrK+m0lw9tmGk6in6qLz5RnU="}]},"maintainers":[{"name":"ktstowell","email":"stowell.kt@gmail.com"}]}},"readme":"# Archives\r\nNode.js Transactional wrapper for MongoDB.\r\n\r\n# Installation\r\n`npm install archives`\r\n\r\n# Why\r\n\r\n Archives seeks to create a consistent transactional abstraction to make data operations easy and modular. Consider the following application structure:\r\n\r\n ```\r\n /modules\r\n  --/users\r\n        users.model.js\r\n  --/sessions\r\n        sessions.model.js\r\n ```\r\n\r\nBoth of these modules have to interact with user data. Implementing a data access abstraction prevents from either module having to know about the other while\r\nstill cutting back on redundancy; encouraging modules to be self contained to fulfill their own requirements.\r\n\r\n# How\r\n\r\n##### init\r\n\r\nIn the location in which you establish your database connection:\r\n\r\n```\r\nvar archives = require('archives')({DB: databaseConfigObject});\r\n\r\narchives.start().then(function() {\r\n  // DB connection successfull, start the server!\r\n});\r\n\r\n```\r\n\r\n##### implementation\r\nWith the above users module in mind, consider:\r\n\r\n```\r\n// Assuming the DAL is passed into the module. This is of course completely arbitrary.\r\nmodule.exports = function(archives) {\r\n  var Users = archives('users');\r\n\r\n  // Users now has access to:\r\n  Users.create({record: databaseInsertionObject}).then(function(createdRecord) {});\r\n  Users.find({query: dataBaseQueryObject}).then(function(locatedRecord) {});\r\n  Users.update({record: dataBaseQueryObject}).then(function(updatedRecord) {});\r\n  Users.delete({{record: dataBaseQueryObject}}).then(function(deletedRecord) {});\r\n};\r\n```\r\n\r\n# Issues\r\nPlease submit the, via the issues tab!\r\n","maintainers":[{"name":"ktstowell","email":"stowell.kt@gmail.com"}],"time":{"modified":"2022-06-13T03:21:51.581Z","created":"2015-04-22T06:21:26.069Z","1.0.0":"2015-04-22T06:21:26.069Z","0.0.1":"2015-05-09T07:20:05.765Z"},"homepage":"https://github.com/ktstowell/archives","keywords":["npm","mongodb"],"repository":{"type":"git","url":"https://github.com/ktstowell/archives.git"},"author":{"name":"Ken Stowell"},"bugs":{"url":"https://github.com/ktstowell/archives/issues"},"license":"ISC","readmeFilename":"README.md"}