{"maintainers":[{"name":"anonymous","email":"jane@cpan.org"}],"keywords":["synchronous","simple","transaction","guid","nonce"],"dist-tags":{"latest":"0.0.7"},"author":{"name":"Jane Arc","email":"jane@cpan.org","url":"http://github.com/janearc"},"description":"A tiny little transaction ID tracker.","readme":"xact-id-tiny\n====\n\nKeeping state sucks. Nobody wants to do it.\n\nIf you find yourself in a situation where you are tracking transaction IDs\n(because, say, you have an asynchronous network app and you want to know how\nmany are outstanding at any given time) you may feel like the code required to\ntrack your transactions is too large and pollutes an otherwise small codebase\nthat just does whatever it's supposed to do.\n\nSo let something else do the lifting for tracking transaction IDs and\ngenerating unique values for those transactions. That's what this package is\nfor.\n\nquickly\n===\n\nI know you're busy. Here's the real simple use pattern:\n\n```javascript\nvar xit  = require( 'xact-id-tiny' )\n  , xact = xit.add_xact( );\n\ndatabase.do_a_thing( args, function (e, rvalue) {\n  if (e) { return new Error( 'gasp! database breakage!' ) }\n  else   { xit.end_xact( xact ); return rvalue;           }\n} );\n```\n\nEasy, right? The rest of the API is defined below.\n\napi\n===\n\n```javascript\nvar n = xit.nonce()\n```\n\nReturns a guaranteed-to-be-unique string. Note that this string is not\nactually stored in the register of open transactions. If you would like\n`xact-id-tiny` to use your fancy unique ID generator, just overwrite the\n`nonce()` function with your own.\n\n```javascript\nvar t = new xit.xact()\nvar t = new xit.xact(serial)\n```\n\nReturns a `transaction` object suitable for use with `add_xact()` and\n`end_xact()`. If you wish to use your own serial (because you have a means of\nproviding your own or whatever), pass it in as an optional argument. The\n`transaction` object is very simple:\n\n```javascript\n{\n  'serial'  : nonce,\n  'state'   : scalar, // 'open' or 'closed'\n  'opened'  : scalar, // the return from moment().format()\n  'closed'  : scalar, // the return from moment().format()\n}\n```\n\nYou may pass in any object that contains these four keys and use it to keep\nstate through transactions.\n\n```javascript\nvar xact = xit.add_xact( transaction );\nvar xact = xit.add_xact( );\n```\n\nAttempts to \"open\" a new transaction, Returns the transaction object stored in the\ntransaction register. Any failures will result in an `Error` being returned with\na hopefully-useful string.\n\nWhen called without arguments, it will create the transaction object for you,\nusing the internal `nonce()` function.\n\n```javascript\nvar xact = xit.end_xact( transaction );\nvar xact = xit.end_xact( serial );\n```\n\nAttempts to \"close\" the transaction specified. Returns an `Error` with a\nhopefully-useful string in the event something goes wrong.\n\n```javascript\nvar xact = xit.get_xact( transaction );\nvar xact = xit.get_xact( serial );\n```\n\nAttempts to return to you a transaction object from either the transaction\nobject (as it exists in the register, which may differ than what you have\nin your local code if you are doing things concurrently or in separate\npackages) or the serial that was used to track that object.\n\nextra stuff\n===\n\n* You may set the `comment` field of your transaction objects. When the\n  transaction is closed, if there is a comment ('opening a socket to foomatic\n  dot com' or whichever), this will be sent to `log4js` in the `INFO` facility\n  along with the delta for that transaction.\n* There's no magic to the objects. Theoretically, you can store anything you\n  like in them, and the api only pays attention to the four (five&hellip;) \n  fields listed above.\n","repository":{"type":"git","url":"git+https://github.com/janearc/xact-id-tiny.git"},"bugs":{"url":"https://github.com/janearc/xact-id-tiny/issues"},"license":"CC0-1.0","versions":{"0.0.1":{"name":"xact-id-tiny","version":"0.0.1","description":"A tiny little transaction ID tracker.","main":"lib/xit.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/janearc/xact-id-tiny.git"},"keywords":["synchronous","simple","transaction","guid","nonce"],"author":{"name":"Jane Arc","email":"jane@cpan.org","url":"http://github.com/janearc"},"license":"CC0-1.0","bugs":{"url":"https://github.com/janearc/xact-id-tiny/issues"},"dependencies":{"moment":">=2.4.0","assert":"*","mocha":"*","singleton":"*"},"homepage":"https://github.com/janearc/xact-id-tiny","gitHead":"fd849f86bb9f6d2669883be171c9d244500b5b4b","_id":"xact-id-tiny@0.0.1","_shasum":"ba7b111e45803819e45d155dd3f0b20f82209a2f","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"anonymous","email":"jane@cpan.org"},"maintainers":[{"name":"anonymous","email":"jane@cpan.org"}],"dist":{"shasum":"ba7b111e45803819e45d155dd3f0b20f82209a2f","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/xact-id-tiny/-/xact-id-tiny-0.0.1.tgz","integrity":"sha512-Bbx+fRVjCP8JIdcnFrsmKmWME5ccizCFQ77f/6GtlmxVrQyojr9s1psrNAzhpFL7y7e5z7RIcWGe14RSEkpSKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFfKMJUmnh9eADAb8rkrZUqQ8r/CqCPWXJfJcVqb2eWgAiEAi89iAcHIB10AbfIveJVoJyd1digtw+KmxkjT/zTouMg="}]}},"0.0.3":{"name":"xact-id-tiny","version":"0.0.3","description":"A tiny little transaction ID tracker.","main":"lib/xit.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/janearc/xact-id-tiny.git"},"keywords":["synchronous","simple","transaction","guid","nonce"],"author":{"name":"Jane Arc","email":"jane@cpan.org","url":"http://github.com/janearc"},"license":"CC0-1.0","bugs":{"url":"https://github.com/janearc/xact-id-tiny/issues"},"dependencies":{"moment":">=2.4.0","assert":"*","mocha":"*","singleton":"*"},"homepage":"https://github.com/janearc/xact-id-tiny","gitHead":"776347ce73e7d0528c14646d6ab8695ea6a20b14","_id":"xact-id-tiny@0.0.3","_shasum":"60afb3caad9877988d6ea2b2f3bb0620c746ecbf","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"anonymous","email":"jane@cpan.org"},"maintainers":[{"name":"anonymous","email":"jane@cpan.org"}],"dist":{"shasum":"60afb3caad9877988d6ea2b2f3bb0620c746ecbf","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/xact-id-tiny/-/xact-id-tiny-0.0.3.tgz","integrity":"sha512-R/IdvfxULGRhSubHDwADw9aZlunlHEK7nsIK91jQHKDX5VNopMPWlM35lOmeuaK/YDiytztGSzTbJtZ9qbECTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID09C17ZJaprMPj8N9cCQPWvRTWwS5RihWwtQPzFZoZtAiEAjnSCINerOiGMha4yDlsMj738hIFjCYuxj9iVStRsp2U="}]}},"0.0.4":{"name":"xact-id-tiny","version":"0.0.4","description":"A tiny little transaction ID tracker.","main":"lib/xit.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/janearc/xact-id-tiny.git"},"keywords":["synchronous","simple","transaction","guid","nonce"],"author":{"name":"Jane Arc","email":"jane@cpan.org","url":"http://github.com/janearc"},"license":"CC0-1.0","bugs":{"url":"https://github.com/janearc/xact-id-tiny/issues"},"dependencies":{"moment":">=2.4.0","assert":"*","mocha":"*","singleton":"*"},"homepage":"https://github.com/janearc/xact-id-tiny","gitHead":"d7926282742c649d84fd41740e14c5f907920243","_id":"xact-id-tiny@0.0.4","_shasum":"bdf9114caa44567379eba5ff87099a9f115fe4f1","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"anonymous","email":"jane@cpan.org"},"maintainers":[{"name":"anonymous","email":"jane@cpan.org"}],"dist":{"shasum":"bdf9114caa44567379eba5ff87099a9f115fe4f1","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/xact-id-tiny/-/xact-id-tiny-0.0.4.tgz","integrity":"sha512-dHJRLvdVEn/fYY1h+SnWmE1et6+r0n/pP9ge6R+kiQ/hBvvH9WwS3m0kq+wc7dfOsNWSeUl2tqnvVOAOI9NSxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChgMjLNqN3cDSskSbhlPQ1pVeo3rlljzQQZSqfeHzDzQIgQStVFxitP2Q0nM4bZ1ymUEfVUEt4Djq9c4ZQnps/7ww="}]}},"0.0.5":{"name":"xact-id-tiny","version":"0.0.5","description":"A tiny little transaction ID tracker.","main":"lib/xit.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/janearc/xact-id-tiny.git"},"keywords":["synchronous","simple","transaction","guid","nonce"],"author":{"name":"Jane Arc","email":"jane@cpan.org","url":"http://github.com/janearc"},"license":"CC0-1.0","bugs":{"url":"https://github.com/janearc/xact-id-tiny/issues"},"dependencies":{"moment":">=2.4.0","assert":"*","mocha":"*","singleton":"*"},"homepage":"https://github.com/janearc/xact-id-tiny","gitHead":"d130d76578367fecde5e96dece7c7c717f246e3b","_id":"xact-id-tiny@0.0.5","_shasum":"d9235a70d8bcfdbefb6e2aa4cfbd2575beec3f5f","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"anonymous","email":"jane@cpan.org"},"maintainers":[{"name":"anonymous","email":"jane@cpan.org"}],"dist":{"shasum":"d9235a70d8bcfdbefb6e2aa4cfbd2575beec3f5f","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/xact-id-tiny/-/xact-id-tiny-0.0.5.tgz","integrity":"sha512-86lkVJO0KcuGNwV85n8wCyT5ozz2HVTd61YbuQ3x2BsQyj2KQDV8kf1gBtGW/xcL069mlOq6D07pEOv9dwx35A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH8BcpLaelRflKP6DZ3kXuIWIE7FRi4ShgYOJUbG8I0VAiEA12KcifSFOTzWfzf7b7KJkz1LJKBtFDNRS4rcB8WYG1I="}]}},"0.0.6":{"name":"xact-id-tiny","version":"0.0.6","description":"A tiny transaction ID tracker.","main":"lib/xit.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/janearc/xact-id-tiny.git"},"keywords":["synchronous","simple","transaction","guid","xit","nonce"],"author":{"name":"Jane Arc","email":"jane@cpan.org","url":"http://github.com/janearc"},"license":"CC0-1.0","bugs":{"url":"https://github.com/janearc/xact-id-tiny/issues"},"dependencies":{"moment":">=2.4.0","assert":"*","mocha":"*"},"homepage":"https://github.com/janearc/xact-id-tiny","gitHead":"5540b7b0f89185190ddce28ade4806eeb390c93d","_id":"xact-id-tiny@0.0.6","_shasum":"973fc9d78255f901cf50403ee0c665b9cff27579","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"anonymous","email":"jane@cpan.org"},"maintainers":[{"name":"anonymous","email":"jane@cpan.org"}],"dist":{"shasum":"973fc9d78255f901cf50403ee0c665b9cff27579","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/xact-id-tiny/-/xact-id-tiny-0.0.6.tgz","integrity":"sha512-DkGYXJ6szWT2D+ce21CqaVW5LE7Y6Rogq/6aLe6/K5ZeuaJQ2XCdF3wBZgkCMGB7dppCK2owtQxBa6XA5pZyJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRLwlSo/eZkhPWso+gFSOHKWKjJGQBLC1Phm/Sbukq9QIgd4dTHcai6VCppNPZuEWtCL3SFx0Wh5cHU84EI9kuKS8="}]}},"0.0.7":{"name":"xact-id-tiny","version":"0.0.7","description":"A tiny little transaction ID tracker.","main":"lib/xit.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/janearc/xact-id-tiny.git"},"keywords":["synchronous","simple","transaction","guid","nonce"],"author":{"name":"Jane Arc","email":"jane@cpan.org","url":"http://github.com/janearc"},"license":"CC0-1.0","bugs":{"url":"https://github.com/janearc/xact-id-tiny/issues"},"dependencies":{"moment":">=2.4.0","log4js":"*","assert":"*","mocha":"*","singleton":"*"},"homepage":"https://github.com/janearc/xact-id-tiny","gitHead":"db3e781b68c635ed0d8cd37c148e0f3451559f2e","_id":"xact-id-tiny@0.0.7","_shasum":"4c305e0680d8ca7a472b904a3b407063adb1d12c","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.1","_npmUser":{"name":"anonymous","email":"jane.arc@pobox.com"},"dist":{"shasum":"4c305e0680d8ca7a472b904a3b407063adb1d12c","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/xact-id-tiny/-/xact-id-tiny-0.0.7.tgz","integrity":"sha512-bWLzZoTn1yjlNYFMLvZKcCCWH/cRpNJo2nXaEDuWbafmI3hNx2zIGEOjHypcxYShlmDUrKX7oHQ4DwkT+sCrHg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFVrxAkT9dTCGpUJZQ+6u8fn4G55uVqvTgQr6GsKy4KAiEA/fMD9l95FPkiKl0XprQmJKBscvi2+J8BFDVr89RVKzo="}]},"maintainers":[{"name":"anonymous","email":"jane@cpan.org"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/xact-id-tiny-0.0.7.tgz_1481419604810_0.3196152304299176"}}},"name":"xact-id-tiny","time":{"modified":"2022-06-29T04:45:32.201Z","created":"2015-02-09T02:15:10.187Z","0.0.1":"2015-02-09T02:15:10.187Z","0.0.3":"2015-02-20T01:07:33.810Z","0.0.4":"2015-02-20T16:01:05.674Z","0.0.5":"2015-02-23T22:53:54.642Z","0.0.6":"2015-02-26T21:59:53.083Z","0.0.7":"2016-12-11T01:26:45.039Z"},"readmeFilename":"README.md","homepage":"https://github.com/janearc/xact-id-tiny"}