{"_id":"xx","_rev":"10-646fca4c1433e96fe5e70b7e8ceeb1b2","name":"xx","description":"Object Locking for JavaScript: It's what you need when you need it, but you have to wait in line to get it.","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"xx","version":"0.0.1","description":"Object Locking for JavaScript: It's what you need when you need it, but you have to wait in line to get it.","engine":["node >=0.2.0"],"author":{"name":"Chris A. Taylor","email":"mrcatid@gmail.com"},"contributors":[],"repository":{"type":"git","url":"http://github.com/gameclosure/xx.git"},"devDependencies":{"mocha":"~1.3.0"},"scripts":{"test":"mocha -R spec -t 5000"},"main":"lib/xx","_id":"xx@0.0.1","dist":{"shasum":"ce2760ab416c0b2ee2d7f835578beec4a4453a7b","tarball":"https://registry.npmjs.org/xx/-/xx-0.0.1.tgz","integrity":"sha512-E4QXLHQkPKZSlgBZyGM5In3tHiBQqKb9Qo8PtEorcQ9seM/YvrbDZOg/z1cISguz2l73R+o1pTNt0X+4S2yCNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAPclqY3CtHH1y+SBdRyINxUYITV9n+w8qHqK8ZKmRBwIgYFK6HcGHIA0+dyLf02W3mtn5yO2E3+cEF90MVwV6tk4="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"catid","email":"mrcatid@gmail.com"},"maintainers":[{"name":"catid","email":"mrcatid@gmail.com"}]},"0.0.2":{"name":"xx","version":"0.0.2","description":"Object Locking for JavaScript: It's what you need when you need it, but you have to wait in line to get it.","engine":["node >=0.2.0"],"author":{"name":"Chris A. Taylor","email":"mrcatid@gmail.com"},"contributors":[],"repository":{"type":"git","url":"http://github.com/gameclosure/xx.git"},"devDependencies":{"mocha":"~1.3.0"},"scripts":{"test":"mocha -R spec -t 5000"},"main":"lib/xx","_id":"xx@0.0.2","dist":{"shasum":"a70719dd41153d59f0e130c07dc8c96f740c5e53","tarball":"https://registry.npmjs.org/xx/-/xx-0.0.2.tgz","integrity":"sha512-+ndZKtF5c/tP7PH1m4EOyjBK08QIJ75aCtAeyNNoMqox8byVPGYdTqbnTolngA6ovvP9sF9riHe/gODrb3bqGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFiNChg23x36BvUt5d5u/r9ue41SjjEx6U9TpmJGoLl7AiEA97ZjP42+Wl3fRSXSQBXSDReoZljKQfNkYKQakls6Klg="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"catid","email":"mrcatid@gmail.com"},"maintainers":[{"name":"catid","email":"mrcatid@gmail.com"}]},"0.0.3":{"name":"xx","version":"0.0.3","description":"Object Locking for JavaScript: It's what you need when you need it, but you have to wait in line to get it.","engine":["node >=0.2.0"],"author":{"name":"Chris A. Taylor","email":"mrcatid@gmail.com"},"contributors":[],"repository":{"type":"git","url":"http://github.com/gameclosure/xx.git"},"devDependencies":{"mocha":"~1.3.0"},"scripts":{"test":"mocha -R spec -t 5000"},"main":"lib/xx","_id":"xx@0.0.3","dist":{"shasum":"41d34aba90fce7f8acc959440d82ed8542b64245","tarball":"https://registry.npmjs.org/xx/-/xx-0.0.3.tgz","integrity":"sha512-/mufj8FGvrKdstR/qtQW7TNJXnfm5+p9nVq52/d9kjejxip9rmYYa3hv8s2g8Wv5mf7Yw9+dImdZzOmrv35b9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwNQM4d8UHcWBJEqeJ/stohg+GGmoeGgQ4YSswJse+jQIhAJzYO8o+1/KdCTH8JkDDiVVCLVAwQGnRsRa2h7cIJE4v"}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"catid","email":"mrcatid@gmail.com"},"maintainers":[{"name":"catid","email":"mrcatid@gmail.com"}]}},"readme":"# <img src=\"http://f.cl.ly/items/3K113g321o0n0W0Y0Z33/Fast%20Forward%20Icon%20in%2032x32%20px.png\" width=25 height=25> xx: Object Locking for JavaScript\n\n> It's what you need when you need it, but you have to wait in line to get it.\n\n***xx* simplifies the synchronization of data objects between concurrent tasks.**\n\n#### Installation\n\n- Node.JS: `npm install xx`\n- Browsers: Add `lib/xx.js` to your HTML page.\n\n## Intro\n\nHere's a brief example that shows how to use `xx`:\n\n```javascript\nvar xx = require('xx'); // import xx\n\nvar config = {}; // Have some data to guard\n\nconfig.xx = xx(); // Create a lock object\n\n// Acquire lock on the object with an async callback:\nconfig.xx(\n\tfunction() {\n\t\t// Invoked when the object is available\n\n\t\t// Call without a function when you want to unlock the object:\n\t\tconfig.xx();\n\t}\n);\n```\n\n## Usage with Async Libraries\n\nHere's a brief example that shows how it can be used with an async library (such as `ff`):\n\n```javascript\nvar xx = require('xx'); // import xx\nvar ff = require('ff'); // Use ff for a demo\n\nvar config = {\n\tfileA: \"A.txt\",\n\tfileB: \"B.txt\"\n}; // Have some data to guard\n\nconfig.xx = xx(); // Create a lock object\n\nvar f = ff(this, function () {\n\n\t// Added: Wait to acquire lock\n\tconfig.xx(f());\n\n}, function () {\n    fs.readFile(config.fileA, f());\n    fs.readFile(config.fileB, f());\n}, function (fileA, fileB) {\n    concatFiles(fileA, fileB, f());\n}, function (result) {\n\tconfig.result = result.toUpperCase();\n\n\t// Added: Done with lock here!\n\tconfig.xx();\n\n    f();\n}).cb(cb);\n```\n\n","maintainers":[{"name":"catid","email":"mrcatid@gmail.com"}],"time":{"modified":"2022-06-29T06:19:08.559Z","created":"2013-03-13T00:20:19.884Z","0.0.1":"2013-03-13T00:20:29.339Z","0.0.2":"2013-03-13T00:52:23.316Z","0.0.3":"2013-03-13T00:57:08.151Z"},"author":{"name":"Chris A. Taylor","email":"mrcatid@gmail.com"},"repository":{"type":"git","url":"http://github.com/gameclosure/xx.git"},"users":{"fgribreau":true},"contributors":[],"readmeFilename":"README.md"}