{"_id":"trier","_rev":"24-fee3b14edb644156b7049a55a5480859","name":"trier","description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","dist-tags":{"latest":"0.3.6"},"versions":{"0.1.0":{"name":"trier","version":"0.1.0","author":{"name":"Phil Booth","email":"pmbooth@gmail.com"},"description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com"}],"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js"},"keywords":["repeat","retry","predicate","conditional","invocation","ender"],"ender":"noop","jam":{"main":"src/trier.js"},"devDependencies":{"jshint":"2.1.x","mocha":"1.13.x","chai":"1.7.x","uglify-js":"2.4.x"},"license":"MIT","scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --colors ./test/trier.js","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\ntask invocation\nfor node\nand browser.\n\n## License\n\n[MIT][license]\n\n## Installation\n\n### Via NPM\n\n```\nnpm install trier\n```\n\n### Via Jam\n\n```\njam install trier\n```\n\n### Via Git\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## Usage\n\n### Loading the library\n\nBoth\nCommonJS\n(e.g.\nif you're running on [Node.js][node]\nor if you're in the browser with [Browserify])\nand AMD\n(e.g. if you're using [Require.js][require])\nloading styles are supported.\nIf neither system is detected,\nthe library defaults to\nexporting it's interface globally\nas `trier`.\n\n### Calling the library\n\ntrier.js exports two public functions,\n`when` and `until`.\n\n#### trier.when (options)\n\nPerforms some action\nwhen prerequesite conditions\nare met.\n\nAccepts a single options object,\nwhich supports the following properties:\n\n* `predicate`: Callback function used to test precondition.\n  Should return `false` to postpone `action` or `true` to perform it.\n  Defaults to nop.\n* `action`: The function you want to call. Defaults to nop.\n* `fail`: Callback function to be invoked if `limit` tries are reached.\n  Defaults to nop.\n* `context`: Context object used when applying `predicate`, `action` and `fail`.\n  Defaults to `{}`.\n* `args`: Arguments array used when applying `predicate`, `action` and `fail`.\n  Defaults to `[]`.\n* `interval`: Retry interval in milliseconds.\n  Use negative numbers to indicate that subsequent retries should wait for twice the preceding interval\n  (i.e. exponential waits).\n  Defaults to -1000.\n* `limit`: Maximum retry count, at which point the call fails and retry iterations cease.\n  Use a negative number to indicate that call should continue indefinitely\n  (i.e. never fail).\n  Defaults to -1.\n\nExample:\n```javascript\ntrier.when({\n    predicate: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(user);\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    pass: function () {\n        next();\n    },\n    interval: 1000,\n    limit: 10\n});\n```\n\n#### trier.until (options)\n\nPerforms some action repeatedly\nuntil postrequisite conditions\nare met.\n\nAccepts a single options object,\nwhich supports the following properties:\n\n* `predicate`: Callback function used to test postcondition.\n  Should return `false` to retry `action` or `true` to stop it.\n  Defaults to nop.\n* `action`: The function you want to call. Defaults to nop.\n* `fail`: Callback function to be invoked if `limit` tries are reached.\n  Defaults to nop.\n* `context`: Context object used when applying `predicate`, `action` and `fail`.\n  Defaults to `{}`.\n* `args`: Arguments array used when applying `predicate`, `action` and `fail`.\n  Defaults to `[]`.\n* `interval`: Retry interval in milliseconds.\n  Use negative numbers to indicate that subsequent retries should wait for twice the preceding interval\n  (i.e. exponential waits).\n  Defaults to -1000.\n* `limit`: Maximum retry count, at which point the call fails and retry iterations cease.\n  Use a negative number to indicate that call should continue indefinitely\n  (i.e. never fail).\n  Defaults to -1.\n\nExample:\n```javascript\nvar sent = false\ntrier.until({\n    predicate: function () {\n        return sent;\n    },\n    action: function () {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n            }\n        });\n    },\n    pass: function () {\n        next();\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## Development\n\n### Dependencies\n\nThe build environment relies on\nNode.js,\n[NPM],\n[JSHint],\n[Mocha],\n[Chai] and\n[UglifyJS].\nAssuming that you already have Node.js and NPM set up,\nyou just need to run `npm install`\nto install all of the dependencies as listed in `package.json`.\n\n### Unit tests\n\nThe unit tests are in `test/trier.js`.\nYou can run them with the command `npm test` or `jake test`.\nTo run the tests in a web browser,\nopen `test/trier.html`.\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[npm]: https://npmjs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"_id":"trier@0.1.0","dist":{"shasum":"58b67b23955429f3e3e01b6e5fef677bcd929964","tarball":"https://registry.npmjs.org/trier/-/trier-0.1.0.tgz","integrity":"sha512-EUJfldF/hrGR+OjS+xnsC6d1n3qx4WZ5le6h3VhFzE3n/CSuQgmM5ca5Z0ibiMwmyXgt2v/pVoi5KOHhmJo3Gg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBT0pCqB0bT/ysFVEHspn2Ku97BeOFYCgypDzzN7JHGWAiEAzjw2qRMPe8cYjiJL+WyrpTWTKbNEmNe1wojurH1azE8="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"},"0.2.0":{"name":"trier","version":"0.2.0","author":{"name":"Phil Booth","email":"pmbooth@gmail.com"},"description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com"}],"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js"},"keywords":["repeat","retry","predicate","conditional","invocation","ender"],"ender":"noop","jam":{"main":"src/trier.js"},"devDependencies":{"jshint":"2.1.x","coffee-script":"1.6.x","mocha":"1.13.x","chai":"1.7.x","spooks":"0.5.x","uglify-js":"2.4.x"},"license":"MIT","scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --compilers coffee:coffee-script --colors ./test/trier.coffee","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\nfunction invocation\nfor node\nand browser.\n\n## Say what?\n\nSometimes,\nyou want to defer\ncalling a function\nuntil a certain\npre-requisite condition is met.\nOther times,\nyou want to\ncall a function\nrepeatedly\nuntil some post-requisite condition\nis satisfied.\nOccasionally,\nyou might even want\nto do both\nfor the same function.\n\nTo save you writing\nexplicit conditions\nand loops\non each of those occasions,\ntrier.js implements\na predicate-based approach\nthat hides the cruft\nbehind a simple,\nfunctional interface.\n\nAdditionally,\nit allows you to easily specify\nretry intervals\nand limits,\nso that your code\ndoesn't waste hog the CPU.\nIt also supports\nexponential incrementation\nof retry intervals,\nwhich can be useful\nwhen handling\nindefinite error states\nsuch as network failure.\n\n## How can I install it?\n\nYou can install trier.js\nwith one of\nthe package managers:\n[NPM];\n[Jam];\n[Component];\nor [Bower].\nThe package name\nfor all of them\nis `trier`:\n\n```\nnpm install trier\n\njam install trier\n\ncomponent install trier\n\nbower install trier\n```\n\nAlternatively,\nyou can just clone\nthe git repository\nfrom GitHub:\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## How do I use it in my code?\n\nIf you are running in\n[Node.js][node],\n[Browserify]\nor another CommonJS-style\nenvironment,\nyou can `require`\ntrier.js like so:\n\n```javascript\nvar trier = require('trier');\n```\n\nIt also the supports\nAMD-style format\npreferred by [Require.js][require]:\n\n```javascriot\nrequire.config({\n    paths: {\n        trier: 'trier/src/trier'\n    }\n});\n\nrequire([ 'trier' ], function (trier) {\n});\n```\n\nIf neither environment\nis detected,\ntrier.js will export its interface globally\nas `trier`.\n\ntrier.js exports\na single public function,\n`attempt`,\nwhich enables you to\nconditionally\nand repeatedly\ncall functions\nwithout writing\nexplicit `if` statements\nor loops.\n\n`trier.attempt` takes one argument,\nan options object\nthat supports\nthe following properties:\n\n* `when`:\n  A callback function\n  used to test the pre-condition\n  for function invocation.\n  Until `when` returns true\n  (or a truthy value),\n  the `action` function\n  will not be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `until`:\n  A callback function\n  used to test the post-condition\n  for terminating\n  function invocation.\n  After `until` returns true\n  (or a truthy value),\n  the `action` function\n  will no longer be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `action`:\n  The invocation target.\n  A function\n  that will be called\n  according to the values\n  returned by\n  `when`\n  and `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `fail`:\n  The error handler.\n  A function\n  that will be called\n  if `limit`\n  falsey values\n  are returned by\n  `when` or `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `limit`:\n  Failure limit,\n  representing the number of times\n  that `when`\n  or `until`\n  may return a falsey value,\n  before the invocation\n  is deemed to have failed\n  and attempts\n  to call `action`\n  will cease.\n  A negative number\n  indicates that the attempt\n  should never fail,\n  instead continuing indefinitely\n  until `when`\n  and `until`\n  have returned\n  truthy values.\n  Defaults to -1.\n* `interval`:\n  A number\n  representing the\n  retry interval,\n  in milliseconds.\n  Use a negative number to indicate\n  that each subsequent retry\n  should wait for twice the interval\n  from the preceding iteration\n  (i.e. exponential incrementation).\n  The default value is\n  -1000,\n  signifying that\n  the initial retry interval\n  should be one second\n  and that each subsequent retry\n  should double\n  the previous interval.\n* `context`:\n  The context object\n  (i.e. `this`)\n  on which to invoke\n  the functions\n  `when`,\n  `until`,\n  `action` and\n  `fail`.\n  Defaults to\n  an empty object.\n* `args`:\n  The arguments array\n  that will be provided\n  to the functions\n  `when`,\n  `until`,\n  `action` and\n  `fail`.\n  Defaults to\n  an empty array.\n\nExamples:\n```javascript\ntrier.attempt({\n    when: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(user);\n        next();\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    interval: 1000,\n    limit: 10\n});\n\nvar sent = false\ntrier.attempt({\n    until: function () {\n        return sent;\n    },\n    action: function () {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n                next();\n            }\n        });\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## How do I set up the build environment?\n\nThe build environment relies on\nNode.js,\nNPM,\n[JSHint],\n[Mocha],\n[Chai],\n[spooks.js][spooks] and\n[UglifyJS].\nAssuming that you already have\nNode.js\nand NPM\ninstalled,\nyou just need to run\n`npm install`\nto set up all of the dependencies\nas listed in `package.json`.\n\nThe unit tests are in `test/trier.js`.\nYou can run them with the command `npm test`.\n\n## What license is trier.js released under?\n\n[MIT][license]\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[npm]: https://npmjs.org/\n[jam]: http://jamjs.org/\n[component]: http://component.io/\n[bower]: http://bower.io/\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[spooks]: https://github.com/philbooth/spooks.js\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"_id":"trier@0.2.0","dist":{"shasum":"4dcab091998fe4370aabff48c1c75e76e081c259","tarball":"https://registry.npmjs.org/trier/-/trier-0.2.0.tgz","integrity":"sha512-426GPDBiAcDioWVe6dQtI45xTKOOro4tG3AXbZhINXqZ/G8qb5DA4sJObNBLbC5XfvhYnSTQL3XIbL82NIQo1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2dyY13t5xx3Hep/3ljtXE3d/5etnCaz13P6aipGPAAQIhAI1CEiJOnF6oxSLen5Jhqvwk3by/KtL0kRSSeHg1Q22Q"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"},"0.2.1":{"name":"trier","version":"0.2.1","author":{"name":"Phil Booth","email":"pmbooth@gmail.com"},"description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com"}],"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js"},"keywords":["repeat","retry","predicate","conditional","invocation","ender"],"ender":"noop","jam":{"main":"src/trier.js"},"devDependencies":{"jshint":"2.1.x","coffee-script":"1.6.x","mocha":"1.13.x","chai":"1.7.x","spooks":"0.5.x","uglify-js":"2.4.x"},"license":"MIT","scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --compilers coffee:coffee-script --colors ./test/trier.coffee","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\nfunction invocation\nfor node\nand browser.\n\n## Say what?\n\nSometimes,\nyou want to defer\ncalling a function\nuntil a certain\npre-requisite condition is met.\nOther times,\nyou want to\ncall a function\nrepeatedly\nuntil some post-requisite condition\nis satisfied.\nOccasionally,\nyou might even want\nto do both\nfor the same function.\n\nTo save you writing\nexplicit conditions\nand loops\non each of those occasions,\ntrier.js implements\na predicate-based approach\nthat hides the cruft\nbehind a simple,\nfunctional interface.\n\nAdditionally,\nit allows you to easily specify\nretry intervals\nand limits,\nso that your code\ndoesn't waste hog the CPU.\nIt also supports\nexponential incrementation\nof retry intervals,\nwhich can be useful\nwhen handling\nindefinite error states\nsuch as network failure.\n\n## How can I install it?\n\nYou can install trier.js\nwith one of\nthe package managers:\n[NPM];\n[Jam];\n[Bower];\nor [Component].\nThe package name\nfor the first three\nis `trier`\nand for Component\nit's `philbooth/trier.js`:\n\n```\nnpm install trier\n\njam install trier\n\ncomponent install philbooth/trier.js\n\nbower install trier\n```\n\nAlternatively,\nyou can just clone\nthe git repository\nfrom GitHub:\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## How do I use it in my code?\n\nIf you are running in\n[Node.js][node],\n[Browserify]\nor another CommonJS-style\nenvironment,\nyou can `require`\ntrier.js like so:\n\n```javascript\nvar trier = require('trier');\n```\n\nIt also the supports\nAMD-style format\npreferred by [Require.js][require]:\n\n```javascriot\nrequire.config({\n    paths: {\n        trier: 'trier/src/trier'\n    }\n});\n\nrequire([ 'trier' ], function (trier) {\n});\n```\n\nIf neither environment\nis detected,\ntrier.js will export its interface globally\nas `trier`.\n\ntrier.js exports\na single public function,\n`attempt`,\nwhich enables you to\nconditionally\nand repeatedly\ncall functions\nwithout writing\nexplicit `if` statements\nor loops.\n\n`trier.attempt` takes one argument,\nan options object\nthat supports\nthe following properties:\n\n* `when`:\n  A callback function\n  used to test the pre-condition\n  for function invocation.\n  Until `when` returns true\n  (or a truthy value),\n  the `action` function\n  will not be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `until`:\n  A callback function\n  used to test the post-condition\n  for terminating\n  function invocation.\n  After `until` returns true\n  (or a truthy value),\n  the `action` function\n  will no longer be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `action`:\n  The invocation target.\n  A function\n  that will be called\n  according to the values\n  returned by\n  `when`\n  and `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `fail`:\n  The error handler.\n  A function\n  that will be called\n  if `limit`\n  falsey values\n  are returned by\n  `when` or `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `limit`:\n  Failure limit,\n  representing the number of times\n  that `when`\n  or `until`\n  may return a falsey value,\n  before the invocation\n  is deemed to have failed\n  and attempts\n  to call `action`\n  will cease.\n  A negative number\n  indicates that the attempt\n  should never fail,\n  instead continuing indefinitely\n  until `when`\n  and `until`\n  have returned\n  truthy values.\n  Defaults to -1.\n* `interval`:\n  A number\n  representing the\n  retry interval,\n  in milliseconds.\n  Use a negative number to indicate\n  that each subsequent retry\n  should wait for twice the interval\n  from the preceding iteration\n  (i.e. exponential incrementation).\n  The default value is\n  -1000,\n  signifying that\n  the initial retry interval\n  should be one second\n  and that each subsequent retry\n  should double\n  the previous interval.\n* `context`:\n  The context object\n  (i.e. `this`)\n  on which to invoke\n  the functions\n  `when`,\n  `until`,\n  `action` and\n  `fail`.\n  Defaults to\n  an empty object.\n* `args`:\n  The arguments array\n  that will be provided\n  to the functions\n  `when`,\n  `until`,\n  `action` and\n  `fail`.\n  Defaults to\n  an empty array.\n\nExamples:\n```javascript\ntrier.attempt({\n    when: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(user);\n        next();\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    interval: 1000,\n    limit: 10\n});\n\nvar sent = false\ntrier.attempt({\n    until: function () {\n        return sent;\n    },\n    action: function () {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n                next();\n            }\n        });\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## How do I set up the build environment?\n\nThe build environment relies on\nNode.js,\nNPM,\n[JSHint],\n[Mocha],\n[Chai],\n[spooks.js][spooks] and\n[UglifyJS].\nAssuming that you already have\nNode.js\nand NPM\ninstalled,\nyou just need to run\n`npm install`\nto set up all of the dependencies\nas listed in `package.json`.\n\nThe unit tests are in `test/trier.js`.\nYou can run them with the command `npm test`.\n\n## What license is trier.js released under?\n\n[MIT][license]\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[npm]: https://npmjs.org/\n[jam]: http://jamjs.org/\n[component]: http://component.io/\n[bower]: http://bower.io/\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[spooks]: https://github.com/philbooth/spooks.js\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"_id":"trier@0.2.1","dist":{"shasum":"bf4de90fc28fa2dfa933cd08964b54c4819791c5","tarball":"https://registry.npmjs.org/trier/-/trier-0.2.1.tgz","integrity":"sha512-0kPB0uWlDjkTRU4vN0Bs4Vqh8COoIRClSVKYKkacDN4yUTYoGGrAZ06zs7pnhIza76QOd0joapyMuvIlHcqNOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9ZJze7rT5/MRgKY6Ooq1sMM6JABHKfJJ4h6tYbT6nIwIhAP+yC9nkI0o206/o5Q3jbuEmCy7+HKBCfcnADATqnQRi"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"},"0.3.0":{"name":"trier","version":"0.3.0","author":{"name":"Phil Booth","email":"pmbooth@gmail.com"},"description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com"}],"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js"},"keywords":["repeat","retry","predicate","conditional","invocation","ender"],"ender":"noop","jam":{"main":"src/trier.js"},"devDependencies":{"jshint":"2.1.x","coffee-script":"1.6.x","mocha":"1.13.x","chai":"1.7.x","spooks":"0.5.x","uglify-js":"2.4.x"},"license":"MIT","scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --compilers coffee:coffee-script --colors ./test/trier.coffee","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\nfunction invocation\nfor node\nand browser.\n\n## Say what?\n\nSometimes,\nyou want to defer\ncalling a function\nuntil a certain\npre-requisite condition is met.\nOther times,\nyou want to\ncall a function\nrepeatedly\nuntil some post-requisite condition\nis satisfied.\nOccasionally,\nyou might even want\nto do both\nfor the same function.\n\nTo save you writing\nexplicit conditions\nand loops\non each of those occasions,\ntrier.js implements\na predicate-based approach\nthat hides the cruft\nbehind a simple,\nfunctional interface.\n\nAdditionally,\nit allows you to easily specify\nretry intervals\nand limits,\nso that your code\ndoesn't hog the CPU.\nIt also supports\nexponential incrementation\nof retry intervals,\nwhich can be useful\nwhen handling\nindefinite error states\nsuch as network failure.\n\n## How can I install it?\n\nYou can install trier.js\nwith one of\nthe package managers:\n[NPM];\n[Jam];\n[Bower];\nor [Component].\nThe package name\nfor the first three\nis `trier`\nand for Component\nit's `philbooth/trier.js`:\n\n```\nnpm install trier\n\njam install trier\n\ncomponent install philbooth/trier.js\n\nbower install trier\n```\n\nAlternatively,\nyou can just clone\nthe git repository\nfrom GitHub:\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## How do I use it in my code?\n\nIf you are running in\n[Node.js][node],\n[Browserify]\nor another CommonJS-style\nenvironment,\nyou can `require`\ntrier.js like so:\n\n```javascript\nvar trier = require('trier');\n```\n\nIt also the supports\nAMD-style format\npreferred by [Require.js][require]:\n\n```javascriot\nrequire.config({\n    paths: {\n        trier: 'trier/src/trier'\n    }\n});\n\nrequire([ 'trier' ], function (trier) {\n});\n```\n\nIf neither environment\nis detected,\ntrier.js will export its interface globally\nas `trier`.\n\ntrier.js exports\na single public function,\n`attempt`,\nwhich enables you to\nconditionally\nand repeatedly\ncall functions\nwithout writing\nexplicit `if` statements\nor loops.\n\n`trier.attempt` takes one argument,\nan options object\nthat supports\nthe following properties:\n\n* `when`:\n  A callback function\n  used to test the pre-condition\n  for function invocation.\n  Until `when` returns true\n  (or a truthy value),\n  the `action` function\n  will not be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `until`:\n  A callback function\n  used to test the post-condition\n  for terminating\n  function invocation.\n  After `until` returns true\n  (or a truthy value),\n  the `action` function\n  will no longer be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `action`:\n  The invocation target.\n  A function\n  that will be called\n  according to the values\n  returned by\n  `when`\n  and `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n  If your implementation\n  of `action`\n  expects any arguments,\n  it will be treated\n  as asynchronous\n  and passed\n  an additional function parameter,\n  `done`.\n  You must call `done`\n  when the action\n  is finished.\n* `fail`:\n  The error handler.\n  A function\n  that will be called\n  if `limit`\n  falsey values\n  are returned by\n  `when` or `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `limit`:\n  Failure limit,\n  representing the number of times\n  that `when`\n  or `until`\n  may return a falsey value,\n  before the invocation\n  is deemed to have failed\n  and attempts\n  to call `action`\n  will cease.\n  A negative number\n  indicates that the attempt\n  should never fail,\n  instead continuing indefinitely\n  until `when`\n  and `until`\n  have returned\n  truthy values.\n  Defaults to -1.\n* `interval`:\n  A number\n  representing the\n  retry interval,\n  in milliseconds.\n  Use a negative number to indicate\n  that each subsequent retry\n  should wait for twice the interval\n  from the preceding iteration\n  (i.e. exponential incrementation).\n  The default value is\n  -1000,\n  signifying that\n  the initial retry interval\n  should be one second\n  and that each subsequent retry\n  should double\n  the previous interval.\n* `context`:\n  The context object\n  (i.e. `this`)\n  on which to invoke\n  the functions\n  `when`,\n  `until`,\n  `action` and\n  `fail`.\n  Defaults to\n  an empty object.\n* `args`:\n  The arguments array\n  that will be provided\n  to the functions\n  `when`,\n  `until`,\n  `action` and\n  `fail`.\n  Defaults to\n  an empty array.\n\nExamples:\n```javascript\n// Attempt to insert a database record, waiting until a\n// connection is available before doing so. The retry\n// interval is 1 second on each occasion and the call\n// will fail after 10 attempts.\ntrier.attempt({\n    when: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(record);\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    interval: 1000,\n    limit: 10\n});\n\n// Attempt to send email message, optionally retrying with\n// exponentially increasing intervals starting at 1 second.\n// Continue to make attempts until the call succeeds.\nvar sent = false\ntrier.attempt({\n    until: function () {\n        return sent;\n    },\n    action: function (done) {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n            }\n            done();\n        });\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## How do I set up the build environment?\n\nThe build environment relies on\nNode.js,\nNPM,\n[JSHint],\n[Mocha],\n[Chai],\n[spooks.js][spooks] and\n[UglifyJS].\nAssuming that you already have\nNode.js\nand NPM\ninstalled,\nyou just need to run\n`npm install`\nto set up all of the dependencies\nas listed in `package.json`.\n\nThe unit tests are in `test/trier.js`.\nYou can run them with the command `npm test`.\n\n## What license is trier.js released under?\n\n[MIT][license]\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[npm]: https://npmjs.org/\n[jam]: http://jamjs.org/\n[component]: http://component.io/\n[bower]: http://bower.io/\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[spooks]: https://github.com/philbooth/spooks.js\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"_id":"trier@0.3.0","dist":{"shasum":"e2b7d18187f7ffc67f5d8d88bed598e1f6582784","tarball":"https://registry.npmjs.org/trier/-/trier-0.3.0.tgz","integrity":"sha512-BU5501VfR8q68SYfEhgQ88Lv17L0NX262e/MwOabE/kNqkm87PiqrVICzZpGj8P3EJIM1CJDNDjA6rSdt21BPg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBMQtD13OBjiTAmfLDou3x54dzYLvtFKKLQNrEmqbHIAiEAxGWEO8rk5dTKC0dqHZeCCjMheqadwm50++7SnEkVQsw="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"},"0.3.1":{"name":"trier","version":"0.3.1","author":{"name":"Phil Booth","email":"pmbooth@gmail.com"},"description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com"}],"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js"},"keywords":["repeat","retry","predicate","conditional","invocation","ender"],"ender":"noop","jam":{"main":"src/trier.js"},"devDependencies":{"jshint":"2.1.x","coffee-script":"1.6.x","mocha":"1.13.x","chai":"1.7.x","spooks":"0.5.x","uglify-js":"2.4.x"},"license":"MIT","scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --compilers coffee:coffee-script --colors ./test/trier.coffee","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\nfunction invocation\nfor node\nand browser.\n\n## Say what?\n\nSometimes,\nyou want to defer\ncalling a function\nuntil a certain\npre-requisite condition is met.\nOther times,\nyou want to\ncall a function\nrepeatedly\nuntil some post-requisite condition\nis satisfied.\nOccasionally,\nyou might even want\nto do both\nfor the same function.\n\nTo save you writing\nexplicit conditions\nand loops\non each of those occasions,\ntrier.js implements\na predicate-based approach\nthat hides the cruft\nbehind a simple,\nfunctional interface.\n\nAdditionally,\nit allows you to easily specify\nretry intervals\nand limits,\nso that your code\ndoesn't hog the CPU.\nIt also supports\nexponential incrementation\nof retry intervals,\nwhich can be useful\nwhen handling\nindefinite error states\nsuch as network failure.\n\n## How can I install it?\n\nYou can install trier.js\nwith one of\nthe package managers:\n[NPM];\n[Jam];\n[Bower];\nor [Component].\nThe package name\nfor the first three\nis `trier`\nand for Component\nit's `philbooth/trier.js`:\n\n```\nnpm install trier\n\njam install trier\n\nbower install trier\n\ncomponent install philbooth/trier.js\n```\n\nAlternatively,\nyou can just clone\nthe git repository\nfrom GitHub:\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## How do I use it in my code?\n\nIf you are running in\n[Node.js][node],\n[Browserify]\nor another CommonJS-style\nenvironment,\nyou can `require`\ntrier.js like so:\n\n```javascript\nvar trier = require('trier');\n```\n\nIt also the supports\nthe AMD-style format\npreferred by [Require.js][require]:\n\n```javascript\nrequire.config({\n    paths: {\n        trier: 'trier/src/trier'\n    }\n});\n\nrequire([ 'trier' ], function (trier) {\n});\n```\n\nIf you are\nincluding trier.js\nwith an HTML `<script>` tag,\nor neither of the above environments\nare detected,\ntrier.js will just export its interface globally\nas `trier`.\n\ntrier.js\nhas no dependencies\nand exports\na single public function,\n`attempt`,\nwhich enables you to\nconditionally\nand repeatedly\ncall functions\nwithout writing\nexplicit `if` statements\nor loops.\n\n`trier.attempt` takes one argument,\nan options object\nthat supports\nthe following properties:\n\n* `when`:\n  A callback function\n  used to test the pre-condition\n  for function invocation.\n  Until `when` returns true\n  (or a truthy value),\n  the `action` function\n  will not be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `until`:\n  A callback function\n  used to test the post-condition\n  for terminating\n  function invocation.\n  After `until` returns true\n  (or a truthy value),\n  the `action` function\n  will no longer be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `action`:\n  The invocation target.\n  A function\n  that will be called\n  according to the values\n  returned by\n  `when`\n  and `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n  If your implementation\n  of `action`\n  expects any arguments,\n  it will be treated\n  as asynchronous\n  and passed\n  an additional function parameter,\n  `done`.\n  You must call `done`\n  when the action\n  is finished.\n* `fail`:\n  The error handler.\n  A function\n  that will be called\n  if `limit`\n  falsey values\n  are returned by\n  `when` or `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `pass`:\n  Success handler.\n  A function\n  that will be called\n  after `until`\n  has returned\n  truthily.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `limit`:\n  Failure limit,\n  representing the number of times\n  that `when`\n  or `until`\n  may return a falsey value,\n  before the invocation\n  is deemed to have failed\n  and attempts\n  to call `action`\n  will cease.\n  A negative number\n  indicates that the attempt\n  should never fail,\n  instead continuing indefinitely\n  until `when`\n  and `until`\n  have returned\n  truthy values.\n  Defaults to -1.\n* `interval`:\n  A number\n  representing the\n  retry interval,\n  in milliseconds.\n  Use a negative number to indicate\n  that each subsequent retry\n  should wait for twice the interval\n  from the preceding iteration\n  (i.e. exponential incrementation).\n  The default value is\n  -1000,\n  signifying that\n  the initial retry interval\n  should be one second\n  and that each subsequent retry\n  should double\n  the previous interval.\n* `context`:\n  The context object\n  (i.e. `this`)\n  on which to invoke\n  the functions\n  `when`,\n  `until`,\n  `action` and\n  `fail`.\n  Defaults to\n  an empty object.\n* `args`:\n  The arguments array\n  that will be provided\n  to the functions\n  `when`,\n  `until`,\n  `action` and\n  `fail`.\n  Defaults to\n  an empty array.\n\nExamples:\n```javascript\n// Attempt to insert a database record, waiting until a\n// connection is available before doing so. The retry\n// interval is 1 second on each occasion and the call\n// will fail after 10 attempts.\ntrier.attempt({\n    when: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(record);\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    interval: 1000,\n    limit: 10\n});\n\n// Attempt to send email message, optionally retrying with\n// exponentially increasing intervals starting at 1 second.\n// Continue to make attempts until the call succeeds.\nvar sent = false\ntrier.attempt({\n    until: function () {\n        return sent;\n    },\n    action: function (done) {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n            }\n            done();\n        });\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## How do I set up the build environment?\n\nThe build environment relies on\nNode.js,\nNPM,\n[JSHint],\n[CoffeeScript],\n[Mocha],\n[Chai],\n[spooks.js][spooks] and\n[UglifyJS].\nAssuming that you already have\nNode.js\nand NPM\ninstalled,\nyou just need to run\n`npm install`\nto set up all of the dependencies\nas listed in `package.json`.\n\nThe unit tests are in `test/trier.coffee`.\nYou can run them with the command `npm test`.\n\n## What license is trier.js released under?\n\n[MIT][license]\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[npm]: https://npmjs.org/\n[jam]: http://jamjs.org/\n[component]: http://component.io/\n[bower]: http://bower.io/\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[coffeescript]: http://coffeescript.org/\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[spooks]: https://github.com/philbooth/spooks.js\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"_id":"trier@0.3.1","dist":{"shasum":"922ab87a85874c8acc27553cd7ae4b918c2144b3","tarball":"https://registry.npmjs.org/trier/-/trier-0.3.1.tgz","integrity":"sha512-dZdGooExQpuowCuzwYoclngcoYjyWZf2+bd1Mti7dXwkBqL2cBw/zyq3z1QsTVmTM7Q0qMyZGYSJYwWFy7UTsw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuFlh7IEMSCW0Z9yIm/8WxhgetMn/V1nP+DCZaMPdiwAIhAIifYKyRCpbbT//Qn1nlW89ZjCosYtK1NgwBYvk+5A6P"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"},"0.3.2":{"name":"trier","version":"0.3.2","author":{"name":"Phil Booth","email":"pmbooth@gmail.com"},"description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com"}],"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js"},"keywords":["repeat","retry","predicate","conditional","invocation","ender"],"ender":"noop","jam":{"main":"src/trier.js"},"devDependencies":{"jshint":"2.1.x","coffee-script":"1.6.x","mocha":"1.13.x","chai":"1.7.x","spooks":"0.5.x","uglify-js":"2.4.x"},"license":"MIT","scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --compilers coffee:coffee-script --colors ./test/trier.coffee","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\nfunction invocation\nfor node\nand browser.\n\n## Say what?\n\nSometimes,\nyou want to defer\ncalling a function\nuntil a certain\npre-requisite condition is met.\nOther times,\nyou want to\ncall a function\nrepeatedly\nuntil some post-requisite condition\nis satisfied.\nOccasionally,\nyou might even want\nto do both\nfor the same function.\n\nTo save you writing\nexplicit conditions\nand loops\non each of those occasions,\ntrier.js implements\na predicate-based approach\nthat hides the cruft\nbehind a simple,\nfunctional interface.\n\nAdditionally,\nit allows you to easily specify\nretry intervals\nand limits,\nso that your code\ndoesn't hog the CPU.\nIt also supports\nexponential incrementation\nof retry intervals,\nwhich can be useful\nwhen handling\nindefinite error states\nsuch as network failure.\n\n## How can I install it?\n\nYou can install trier.js\nwith one of\nthe package managers:\n[NPM];\n[Jam];\n[Bower];\nor [Component].\nThe package name\nfor the first three\nis `trier`\nand for Component\nit's `philbooth/trier.js`:\n\n```\nnpm install trier\n\njam install trier\n\nbower install trier\n\ncomponent install philbooth/trier.js\n```\n\nAlternatively,\nyou can just clone\nthe git repository\nfrom GitHub:\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## How do I use it in my code?\n\nIf you are running in\n[Node.js][node],\n[Browserify]\nor another CommonJS-style\nenvironment,\nyou can `require`\ntrier.js like so:\n\n```javascript\nvar trier = require('trier');\n```\n\nIt also the supports\nthe AMD-style format\npreferred by [Require.js][require]:\n\n```javascript\nrequire.config({\n    paths: {\n        trier: 'trier/src/trier'\n    }\n});\n\nrequire([ 'trier' ], function (trier) {\n});\n```\n\nIf you are\nincluding trier.js\nwith an HTML `<script>` tag,\nor neither of the above environments\nare detected,\ntrier.js will just export its interface globally\nas `trier`.\n\ntrier.js\nhas no dependencies\nand exports\na single public function,\n`attempt`,\nwhich enables you to\nconditionally\nand repeatedly\ncall functions\nwithout writing\nexplicit `if` statements\nor loops.\n\n`trier.attempt` takes one argument,\nan options object\nthat supports\nthe following properties:\n\n* `when`:\n  A callback function\n  used to test the pre-condition\n  for function invocation.\n  Until `when` returns true\n  (or a truthy value),\n  the `action` function\n  will not be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `until`:\n  A callback function\n  used to test the post-condition\n  for terminating\n  function invocation.\n  After `until` returns true\n  (or a truthy value),\n  the `action` function\n  will no longer be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `action`:\n  The invocation target.\n  A function\n  that will be called\n  according to the values\n  returned by\n  `when`\n  and `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n  If your implementation\n  of `action`\n  expects any arguments,\n  it will be treated\n  as asynchronous\n  and passed\n  an additional function parameter,\n  `done`.\n  You must call `done`\n  when the action\n  is finished.\n* `fail`:\n  The error handler.\n  A function\n  that will be called\n  if `limit`\n  falsey values\n  are returned by\n  `when` or `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `pass`:\n  Success handler.\n  A function\n  that will be called\n  after `until`\n  has returned\n  truthily.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `limit`:\n  Failure limit,\n  representing the number of times\n  that `when`\n  and `until`\n  may return a falsey value,\n  before the invocation\n  is deemed to have failed\n  and attempts\n  to call `action`\n  will cease.\n  A negative number\n  indicates that the attempt\n  should never fail,\n  instead continuing indefinitely\n  until `when`\n  and `until`\n  have returned\n  truthy values.\n  Defaults to -1.\n* `interval`:\n  A number\n  representing the\n  retry interval,\n  in milliseconds.\n  Use a negative number to indicate\n  that each subsequent retry\n  should wait for twice the interval\n  from the preceding iteration\n  (i.e. exponential incrementation).\n  The default value is\n  -1000,\n  signifying that\n  the initial retry interval\n  should be one second\n  and that each subsequent retry\n  should double\n  the previous interval.\n* `context`:\n  The context object\n  (i.e. `this`)\n  on which to invoke\n  the functions\n  `when`,\n  `until`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty object.\n* `args`:\n  The arguments array\n  that will be provided\n  to the functions\n  `when`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty array.\n\nExamples:\n```javascript\n// Attempt to insert a database record, waiting until a\n// connection is available before doing so. The retry\n// interval is 1 second on each occasion and the call\n// will fail after 10 attempts.\ntrier.attempt({\n    when: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(record);\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    interval: 1000,\n    limit: 10\n});\n\n// Attempt to send an email message, optionally retrying with\n// exponentially increasing intervals starting at 1 second.\n// Continue to make attempts until the call succeeds.\nvar sent = false\ntrier.attempt({\n    until: function () {\n        return sent;\n    },\n    action: function (done) {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n            }\n            done();\n        });\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## How do I set up the build environment?\n\nThe build environment relies on\nNode.js,\nNPM,\n[JSHint],\n[CoffeeScript],\n[Mocha],\n[Chai],\n[spooks.js][spooks] and\n[UglifyJS].\nAssuming that you already have\nNode.js\nand NPM\ninstalled,\nyou just need to run\n`npm install`\nto set up all of the dependencies\nas listed in `package.json`.\n\nThe unit tests are in `test/trier.coffee`.\nYou can run them with the command `npm test`.\n\n## What license is trier.js released under?\n\n[MIT][license]\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[npm]: https://npmjs.org/\n[jam]: http://jamjs.org/\n[component]: http://component.io/\n[bower]: http://bower.io/\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[coffeescript]: http://coffeescript.org/\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[spooks]: https://github.com/philbooth/spooks.js\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"_id":"trier@0.3.2","dist":{"shasum":"39056efd58f9f3acda813cef7f7e3e57568b1cfa","tarball":"https://registry.npmjs.org/trier/-/trier-0.3.2.tgz","integrity":"sha512-awAjEH4xgEjR3+7zhC7gN+I1d1DJKtsPJ3CkfI7Xxrx25nOSowJZNdI6aE4Y6Dv2hrSx1x4Kv58vpBaTfF61qw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXAz7DAuOVRUZfCy5gUcRIyrV7eha6qiyE7I05HdxRwAiASrWAdNqkc6h9NuJ6E5MRUFEcdqKjENAW6AA4rnWIQxw=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"},"0.3.3":{"name":"trier","version":"0.3.3","author":{"name":"Phil Booth","email":"pmbooth@gmail.com"},"description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com"}],"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js"},"keywords":["repeat","retry","predicate","conditional","invocation","ender"],"ender":"noop","jam":{"main":"src/trier.js"},"devDependencies":{"jshint":"2.1.x","coffee-script":"1.6.x","mocha":"1.13.x","chai":"1.7.x","spooks":"0.5.x","uglify-js":"2.4.x"},"license":"MIT","scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --compilers coffee:coffee-script --colors ./test/trier.coffee","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\nfunction invocation\nfor node\nand browser.\n\n## Say what?\n\nSometimes,\nyou want to defer\ncalling a function\nuntil a certain\npre-requisite condition is met.\nOther times,\nyou want to\ncall a function\nrepeatedly\nuntil some post-requisite condition\nis satisfied.\nOccasionally,\nyou might even want\nto do both\nfor the same function.\n\nTo save you writing\nexplicit conditions\nand loops\non each of those occasions,\ntrier.js implements\na predicate-based approach\nthat hides the cruft\nbehind a simple,\nfunctional interface.\n\nAdditionally,\nit allows you to easily specify\nretry intervals\nand limits,\nso that your code\ndoesn't hog the CPU.\nIt also supports\nexponential incrementation\nof retry intervals,\nwhich can be useful\nwhen handling\nindefinite error states\nsuch as network failure.\n\n## How can I install it?\n\nYou can install trier.js\nwith one of\nthe package managers:\n[NPM];\n[Jam];\n[Bower];\nor [Component].\nThe package name\nfor the first three\nis `trier`\nand for Component\nit's `philbooth/trier.js`:\n\n```\nnpm install trier\n\njam install trier\n\nbower install trier\n\ncomponent install philbooth/trier.js\n```\n\nAlternatively,\nyou can just clone\nthe git repository\nfrom GitHub:\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## How do I use it in my code?\n\nIf you are running in\n[Node.js][node],\n[Browserify]\nor another CommonJS-style\nenvironment,\nyou can `require`\ntrier.js like so:\n\n```javascript\nvar trier = require('trier');\n```\n\nIt also the supports\nthe AMD-style format\npreferred by [Require.js][require]:\n\n```javascript\nrequire.config({\n    paths: {\n        trier: 'trier/src/trier'\n    }\n});\n\nrequire([ 'trier' ], function (trier) {\n});\n```\n\nIf you are\nincluding trier.js\nwith an HTML `<script>` tag,\nor neither of the above environments\nare detected,\ntrier.js will just export its interface globally\nas `trier`.\n\ntrier.js\nhas no dependencies\nand exports\na single public function,\n`attempt`,\nwhich enables you to\nconditionally\nand repeatedly\ncall functions\nwithout writing\nexplicit `if` statements\nor loops.\n\n`trier.attempt` takes one argument,\nan options object\nthat supports\nthe following properties:\n\n* `when`:\n  A callback function\n  used to test the pre-condition\n  for function invocation.\n  Until `when` returns true\n  (or a truthy value),\n  the `action` function\n  will not be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `until`:\n  A callback function\n  used to test the post-condition\n  for terminating\n  function invocation.\n  After `until` returns true\n  (or a truthy value),\n  the `action` function\n  will no longer be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `action`:\n  The invocation target.\n  A function\n  that will be called\n  according to the values\n  returned by\n  `when`\n  and `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n  If your implementation\n  of `action`\n  expects any arguments,\n  it will be treated\n  as asynchronous\n  and passed\n  an additional function parameter,\n  `done`.\n  You must call `done`\n  when the action\n  is finished.\n* `fail`:\n  The error handler.\n  A function\n  that will be called\n  if `limit`\n  falsey values\n  are returned by\n  `when` or `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `pass`:\n  Success handler.\n  A function\n  that will be called\n  after `until`\n  has returned\n  truthily.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `limit`:\n  Failure limit,\n  representing the number of times\n  that `when`\n  and `until`\n  may return a falsey value,\n  before the invocation\n  is deemed to have failed\n  and attempts\n  to call `action`\n  will cease.\n  A negative number\n  indicates that the attempt\n  should never fail,\n  instead continuing indefinitely\n  until `when`\n  and `until`\n  have returned\n  truthy values.\n  Defaults to -1.\n* `interval`:\n  A number\n  representing the\n  retry interval,\n  in milliseconds.\n  Use a negative number to indicate\n  that each subsequent retry\n  should wait for twice the interval\n  from the preceding iteration\n  (i.e. exponential incrementation).\n  The default value is\n  -1000,\n  signifying that\n  the initial retry interval\n  should be one second\n  and that each subsequent retry\n  should double\n  the previous interval.\n* `context`:\n  The context object\n  (i.e. `this`)\n  on which to invoke\n  the functions\n  `when`,\n  `until`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty object.\n* `args`:\n  The arguments array\n  that will be provided\n  to the functions\n  `when`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty array.\n\nExamples:\n```javascript\n// Attempt to insert a database record, waiting until a\n// connection is available before doing so. The retry\n// interval is 1 second on each occasion and the call\n// will fail after 10 attempts.\ntrier.attempt({\n    when: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(record);\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    interval: 1000,\n    limit: 10\n});\n\n// Attempt to send an email message, optionally retrying with\n// exponentially increasing intervals starting at 1 second.\n// Continue to make attempts until the call succeeds.\nvar sent = false\ntrier.attempt({\n    until: function () {\n        return sent;\n    },\n    action: function (done) {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n            }\n            done();\n        });\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## How do I set up the build environment?\n\nThe build environment relies on\nNode.js,\nNPM,\n[JSHint],\n[CoffeeScript],\n[Mocha],\n[Chai],\n[spooks.js][spooks] and\n[UglifyJS].\nAssuming that you already have\nNode.js\nand NPM\ninstalled,\nyou just need to run\n`npm install`\nto set up all of the dependencies\nas listed in `package.json`.\n\nThe unit tests are in `test/trier.coffee`.\nYou can run them with the command `npm test`.\n\n## What license is trier.js released under?\n\n[MIT][license]\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[npm]: https://npmjs.org/\n[jam]: http://jamjs.org/\n[component]: http://component.io/\n[bower]: http://bower.io/\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[coffeescript]: http://coffeescript.org/\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[spooks]: https://github.com/philbooth/spooks.js\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"_id":"trier@0.3.3","dist":{"shasum":"2c0fee04625949c18af8023a9cb4e28dc41c1c21","tarball":"https://registry.npmjs.org/trier/-/trier-0.3.3.tgz","integrity":"sha512-CJrnhHDpNHlyrSCiGid/lCD+VUPwAWTgKxtVje9m0IaKDksk75vbr8XZZBeDBDQyAqHj3pg6qNI2JPfJiQGvGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3arV5RVrOx+3En/rz0Dx2GugPbXcqVzskm3SCu7tRDwIgDqVtc7mykYgT197r2PVJjBOozTyWEopvWLw8QxElD4g="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"},"0.3.4":{"name":"trier","version":"0.3.4","author":{"name":"Phil Booth","email":"pmbooth@gmail.com"},"description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com"},{"name":"Andrew Lawson"}],"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js"},"keywords":["repeat","retry","predicate","conditional","invocation","ender"],"ender":"noop","jam":{"main":"src/trier.js"},"devDependencies":{"jshint":"2.1.x","coffee-script":"1.6.x","mocha":"1.13.x","chai":"1.7.x","spooks":"0.5.x","uglify-js":"2.4.x"},"license":"MIT","scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --compilers coffee:coffee-script --colors ./test/trier.coffee","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\nfunction invocation\nfor node\nand browser.\n\n## Say what?\n\nSometimes,\nyou want to defer\ncalling a function\nuntil a certain\npre-requisite condition is met.\nOther times,\nyou want to\ncall a function\nrepeatedly\nuntil some post-requisite condition\nis satisfied.\nOccasionally,\nyou might even want\nto do both\nfor the same function.\n\nTo save you writing\nexplicit conditions\nand loops\non each of those occasions,\ntrier.js implements\na predicate-based approach\nthat hides the cruft\nbehind a simple,\nfunctional interface.\n\nAdditionally,\nit allows you to easily specify\nretry intervals\nand limits,\nso that your code\ndoesn't hog the CPU.\nIt also supports\nexponential incrementation\nof retry intervals,\nwhich can be useful\nwhen handling\nindefinite error states\nsuch as network failure.\n\n## How can I install it?\n\nYou can install trier.js\nwith one of\nthe package managers:\n[NPM];\n[Jam];\n[Bower];\nor [Component].\nThe package name\nfor the first three\nis `trier`\nand for Component\nit's `philbooth/trier.js`:\n\n```\nnpm install trier\n\njam install trier\n\nbower install trier\n\ncomponent install philbooth/trier.js\n```\n\nAlternatively,\nyou can just clone\nthe git repository\nfrom GitHub:\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## How do I use it in my code?\n\nIf you are running in\n[Node.js][node],\n[Browserify]\nor another CommonJS-style\nenvironment,\nyou can `require`\ntrier.js like so:\n\n```javascript\nvar trier = require('trier');\n```\n\nIt also the supports\nthe AMD-style format\npreferred by [Require.js][require]:\n\n```javascript\nrequire.config({\n    paths: {\n        trier: 'trier.js/src/trier'\n    }\n});\n\nrequire([ 'trier' ], function (trier) {\n});\n```\n\nIf you are\nincluding trier.js\nwith an HTML `<script>` tag,\nor neither of the above environments\nare detected,\ntrier.js will just export its interface globally\nas `trier`.\n\ntrier.js\nhas no dependencies\nand exports\na single public function,\n`attempt`,\nwhich enables you to\nconditionally\nand repeatedly\ncall functions\nwithout writing\nexplicit `if` statements\nor loops.\n\n`trier.attempt` takes one argument,\nan options object\nthat supports\nthe following properties:\n\n* `when`:\n  A callback function\n  used to test the pre-condition\n  for function invocation.\n  Until `when` returns true\n  (or a truthy value),\n  the `action` function\n  will not be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `until`:\n  A callback function\n  used to test the post-condition\n  for terminating\n  function invocation.\n  After `until` returns true\n  (or a truthy value),\n  the `action` function\n  will no longer be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `action`:\n  The invocation target.\n  A function\n  that will be called\n  according to the values\n  returned by\n  `when`\n  and `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n  If your implementation\n  of `action`\n  expects any arguments,\n  it will be treated\n  as asynchronous\n  and passed\n  an additional function parameter,\n  `done`.\n  You must call `done`\n  when the action\n  is finished.\n* `fail`:\n  The error handler.\n  A function\n  that will be called\n  if `limit`\n  falsey values\n  are returned by\n  `when` or `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `pass`:\n  Success handler.\n  A function\n  that will be called\n  after `until`\n  has returned\n  truthily.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `limit`:\n  Failure limit,\n  representing the number of times\n  that `when`\n  and `until`\n  may return a falsey value,\n  before the invocation\n  is deemed to have failed\n  and attempts\n  to call `action`\n  will cease.\n  A negative number\n  indicates that the attempt\n  should never fail,\n  instead continuing indefinitely\n  until `when`\n  and `until`\n  have returned\n  truthy values.\n  Defaults to -1.\n* `interval`:\n  A number\n  representing the\n  retry interval,\n  in milliseconds.\n  Use a negative number to indicate\n  that each subsequent retry\n  should wait for twice the interval\n  from the preceding iteration\n  (i.e. exponential incrementation).\n  The default value is\n  -1000,\n  signifying that\n  the initial retry interval\n  should be one second\n  and that each subsequent retry\n  should double\n  the previous interval.\n* `context`:\n  The context object\n  (i.e. `this`)\n  on which to invoke\n  the functions\n  `when`,\n  `until`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty object.\n* `args`:\n  The arguments array\n  that will be provided\n  to the functions\n  `when`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty array.\n\nExamples:\n```javascript\n// Attempt to insert a database record, waiting until a\n// connection is available before doing so. The retry\n// interval is 1 second on each occasion and the call\n// will fail after 10 attempts.\ntrier.attempt({\n    when: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(record);\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    interval: 1000,\n    limit: 10\n});\n\n// Attempt to send an email message, optionally retrying with\n// exponentially increasing intervals starting at 1 second.\n// Continue to make attempts until the call succeeds.\nvar sent = false\ntrier.attempt({\n    until: function () {\n        return sent;\n    },\n    action: function (done) {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n            }\n            done();\n        });\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## How do I set up the build environment?\n\nThe build environment relies on\nNode.js,\nNPM,\n[JSHint],\n[CoffeeScript],\n[Mocha],\n[Chai],\n[spooks.js][spooks] and\n[UglifyJS].\nAssuming that you already have\nNode.js\nand NPM\ninstalled,\nyou just need to run\n`npm install`\nto set up all of the dependencies\nas listed in `package.json`.\n\nThe unit tests are in `test/trier.coffee`.\nYou can run them with the command `npm test`.\n\n## What license is trier.js released under?\n\n[MIT][license]\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[npm]: https://npmjs.org/\n[jam]: http://jamjs.org/\n[component]: http://component.io/\n[bower]: http://bower.io/\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[coffeescript]: http://coffeescript.org/\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[spooks]: https://github.com/philbooth/spooks.js\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"_id":"trier@0.3.4","dist":{"shasum":"27444ac85a50d33a30c60ae3ccdd8c2b76faa7cf","tarball":"https://registry.npmjs.org/trier/-/trier-0.3.4.tgz","integrity":"sha512-xS2JsavNNcB5nVPZHlZADK/BRn0KPMkaWqJjWaS5+UfAi1/rUv9D13j9I+lhwg8XNnOzn2YtjlRWlw4PKWwLFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLq8ImP28SkWgldtbXrKyPon6ctO92mfEP7h64Q4b8SwIhAP2Bf2zMwVkOCLnrTeboIzpxl34Ey7W6zPkB7Ctfuvth"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"},"0.3.5":{"name":"trier","version":"0.3.5","description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","homepage":"https://github.com/philbooth/trier.js","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"license":"MIT","author":{"name":"Phil Booth","email":"pmbooth@gmail.com","url":"https://github.com/philbooth"},"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js.git"},"keywords":["repeat","retry","predicate","conditional","invocation"],"devDependencies":{"jshint":"2.2.x","coffee-script":"1.6.x","mocha":"1.13.x","chai":"1.8.x","spooks":"0.5.x","uglify-js":"2.4.x"},"scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --compilers coffee:coffee-script --colors ./test/trier.coffee","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com","url":"https://github.com/philbooth"},{"name":"Andrew Lawson","url":"https://github.com/adlawson"}],"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\nfunction invocation\nfor node\nand browser.\n\n## Say what?\n\nSometimes,\nyou want to defer\ncalling a function\nuntil a certain\npre-requisite condition is met.\nOther times,\nyou want to\ncall a function\nrepeatedly\nuntil some post-requisite condition\nis satisfied.\nOccasionally,\nyou might even want\nto do both\nfor the same function.\n\nTo save you writing\nexplicit conditions\nand loops\non each of those occasions,\ntrier.js implements\na predicate-based approach\nthat hides the cruft\nbehind a simple,\nfunctional interface.\n\nAdditionally,\nit allows you to easily specify\nretry intervals\nand limits,\nso that your code\ndoesn't hog the CPU.\nIt also supports\nexponential incrementation\nof retry intervals,\nwhich can be useful\nwhen handling\nindefinite error states\nsuch as network failure.\n\n## How can I install it?\n\nYou can install trier.js\nwith one of\nthe package managers:\n[NPM];\n[Jam];\n[Bower];\nor [Component].\nThe package name\nfor the first three\nis `trier`\nand for Component\nit's `philbooth/trier.js`:\n\n```\nnpm install trier\n\njam install trier\n\nbower install trier\n\ncomponent install philbooth/trier.js\n```\n\nAlternatively,\nyou can just clone\nthe git repository\nfrom GitHub:\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## How do I use it in my code?\n\nIf you are running in\n[Node.js][node],\n[Browserify]\nor another CommonJS-style\nenvironment,\nyou can `require`\ntrier.js like so:\n\n```javascript\nvar trier = require('trier');\n```\n\nIt also the supports\nthe AMD-style format\npreferred by [Require.js][require]:\n\n```javascript\nrequire.config({\n    paths: {\n        trier: 'trier.js/src/trier'\n    }\n});\n\nrequire([ 'trier' ], function (trier) {\n});\n```\n\nIf you are\nincluding trier.js\nwith an HTML `<script>` tag,\nor neither of the above environments\nare detected,\ntrier.js will just export its interface globally\nas `trier`.\n\ntrier.js\nhas no dependencies\nand exports\na single public function,\n`attempt`,\nwhich enables you to\nconditionally\nand repeatedly\ncall functions\nwithout writing\nexplicit `if` statements\nor loops.\n\n`trier.attempt` takes one argument,\nan options object\nthat supports\nthe following properties:\n\n* `when`:\n  A callback function\n  used to test the pre-condition\n  for function invocation.\n  Until `when` returns true\n  (or a truthy value),\n  the `action` function\n  will not be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `until`:\n  A callback function\n  used to test the post-condition\n  for terminating\n  function invocation.\n  After `until` returns true\n  (or a truthy value),\n  the `action` function\n  will no longer be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `action`:\n  The invocation target.\n  A function\n  that will be called\n  according to the values\n  returned by\n  `when`\n  and `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n  If your implementation\n  of `action`\n  expects any arguments,\n  it will be treated\n  as asynchronous\n  and passed\n  an additional function parameter,\n  `done`.\n  You must call `done`\n  when the action\n  is finished.\n* `fail`:\n  The error handler.\n  A function\n  that will be called\n  if `limit`\n  falsey values\n  are returned by\n  `when` or `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `pass`:\n  Success handler.\n  A function\n  that will be called\n  after `until`\n  has returned\n  truthily.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `limit`:\n  Failure limit,\n  representing the number of times\n  that `when`\n  and `until`\n  may return a falsey value,\n  before the invocation\n  is deemed to have failed\n  and attempts\n  to call `action`\n  will cease.\n  A negative number\n  indicates that the attempt\n  should never fail,\n  instead continuing indefinitely\n  until `when`\n  and `until`\n  have returned\n  truthy values.\n  Defaults to -1.\n* `interval`:\n  A number\n  representing the\n  retry interval,\n  in milliseconds.\n  Use a negative number to indicate\n  that each subsequent retry\n  should wait for twice the interval\n  from the preceding iteration\n  (i.e. exponential incrementation).\n  The default value is\n  -1000,\n  signifying that\n  the initial retry interval\n  should be one second\n  and that each subsequent retry\n  should double\n  the previous interval.\n* `context`:\n  The context object\n  (i.e. `this`)\n  on which to invoke\n  the functions\n  `when`,\n  `until`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty object.\n* `args`:\n  The arguments array\n  that will be provided\n  to the functions\n  `when`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty array.\n\nExamples:\n```javascript\n// Attempt to insert a database record, waiting until a\n// connection is available before doing so. The retry\n// interval is 1 second on each occasion and the call\n// will fail after 10 attempts.\ntrier.attempt({\n    when: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(record);\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    interval: 1000,\n    limit: 10\n});\n\n// Attempt to send an email message, optionally retrying with\n// exponentially increasing intervals starting at 1 second.\n// Continue to make attempts until the call succeeds.\nvar sent = false\ntrier.attempt({\n    until: function () {\n        return sent;\n    },\n    action: function (done) {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n            }\n            done();\n        });\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## How do I set up the build environment?\n\nThe build environment relies on\nNode.js,\nNPM,\n[JSHint],\n[CoffeeScript],\n[Mocha],\n[Chai],\n[spooks.js][spooks] and\n[UglifyJS].\nAssuming that you already have\nNode.js\nand NPM\ninstalled,\nyou just need to run\n`npm install`\nto set up all of the dependencies\nas listed in `package.json`.\n\nThe unit tests are in `test/trier.coffee`.\nYou can run them with the command `npm test`.\n\n## What license is trier.js released under?\n\n[MIT][license]\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[npm]: https://npmjs.org/\n[jam]: http://jamjs.org/\n[component]: http://component.io/\n[bower]: http://bower.io/\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[coffeescript]: http://coffeescript.org/\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[spooks]: https://github.com/philbooth/spooks.js\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n\n","readmeFilename":"README.md","_id":"trier@0.3.5","dist":{"shasum":"6f9e5a4a32f3cc1857d0f88249e30c6be4cf3444","tarball":"https://registry.npmjs.org/trier/-/trier-0.3.5.tgz","integrity":"sha512-Ydng+AUv+TkG19tL5U52EQr7jVcbv+eLMpiplbIIkfNW3q0vPnNrXc0ruFXDEZ5D3QLVlXxv7Dou0D91wltN2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0X46CWey7OwGBSjiDs5bJK4V1CcEm9VVuBYS8dVc+0gIhAKXooFJZssoIde70UR2m588lf8u8tk1uSPG959kHDPVT"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"},"0.3.6":{"name":"trier","version":"0.3.6","description":"Because everyone loves a trier! Conditional and repeated task invocation for node and browser.","homepage":"https://github.com/philbooth/trier.js","bugs":{"url":"https://github.com/philbooth/trier.js/issues"},"license":"MIT","author":{"name":"Phil Booth","email":"pmbooth@gmail.com","url":"https://github.com/philbooth"},"main":"./src/trier","repository":{"type":"git","url":"https://github.com/philbooth/trier.js.git"},"keywords":["repeat","retry","predicate","conditional","invocation"],"devDependencies":{"jshint":"2.2.x","coffee-script":"1.6.x","mocha":"1.13.x","chai":"1.8.x","spooks":"0.5.x","uglify-js":"2.4.x"},"scripts":{"lint":"./node_modules/.bin/jshint ./src/trier.js --config config/jshint.json","test":"./node_modules/.bin/mocha --ui tdd --reporter spec --compilers coffee:coffee-script --colors ./test/trier.coffee","minify":"./node_modules/.bin/uglifyjs ./src/trier.js --compress --mangle --output ./lib/trier.min.js"},"contributors":[{"name":"Phil Booth","email":"pmbooth@gmail.com","url":"https://github.com/philbooth"},{"name":"Andrew Lawson","url":"https://github.com/adlawson"},{"name":"Tim O'Sulg","url":"https://github.com/timgluz"}],"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\nfunction invocation\nfor node\nand browser.\n\n## Say what?\n\nSometimes,\nyou want to defer\ncalling a function\nuntil a certain\npre-requisite condition is met.\nOther times,\nyou want to\ncall a function\nrepeatedly\nuntil some post-requisite condition\nis satisfied.\nOccasionally,\nyou might even want\nto do both\nfor the same function.\n\nTo save you writing\nexplicit conditions\nand loops\non each of those occasions,\ntrier.js implements\na predicate-based approach\nthat hides the cruft\nbehind a simple,\nfunctional interface.\n\nAdditionally,\nit allows you to easily specify\nretry intervals\nand limits,\nso that your code\ndoesn't hog the CPU.\nIt also supports\nexponential incrementation\nof retry intervals,\nwhich can be useful\nwhen handling\nindefinite error states\nsuch as network failure.\n\n## How can I install it?\n\nYou can install trier.js\nwith one of\nthe package managers:\n[NPM];\n[Jam];\n[Bower];\nor [Component].\nThe package name\nfor the first three\nis `trier`\nand for Component\nit's `philbooth/trier.js`:\n\n```\nnpm install trier\n\njam install trier\n\nbower install trier\n\ncomponent install philbooth/trier.js\n```\n\nAlternatively,\nyou can just clone\nthe git repository\nfrom GitHub:\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## How do I use it in my code?\n\nIf you are running in\n[Node.js][node],\n[Browserify]\nor another CommonJS-style\nenvironment,\nyou can `require`\ntrier.js like so:\n\n```javascript\nvar trier = require('trier');\n```\n\nIt also the supports\nthe AMD-style format\npreferred by [Require.js][require]:\n\n```javascript\nrequire.config({\n    paths: {\n        trier: 'trier.js/src/trier'\n    }\n});\n\nrequire([ 'trier' ], function (trier) {\n});\n```\n\nIf you are\nincluding trier.js\nwith an HTML `<script>` tag,\nor neither of the above environments\nare detected,\ntrier.js will just export its interface globally\nas `trier`.\n\ntrier.js\nhas no dependencies\nand exports\na single public function,\n`attempt`,\nwhich enables you to\nconditionally\nand repeatedly\ncall functions\nwithout writing\nexplicit `if` statements\nor loops.\n\n`trier.attempt` takes one argument,\nan options object\nthat supports\nthe following properties:\n\n* `when`:\n  A callback function\n  used to test the pre-condition\n  for function invocation.\n  Until `when` returns true\n  (or a truthy value),\n  the `action` function\n  will not be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `until`:\n  A callback function\n  used to test the post-condition\n  for terminating\n  function invocation.\n  After `until` returns true\n  (or a truthy value),\n  the `action` function\n  will no longer be called.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () { return true; }`.\n* `action`:\n  The invocation target.\n  A function\n  that will be called\n  according to the values\n  returned by\n  `when`\n  and `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n  If your implementation\n  of `action`\n  expects any arguments,\n  it will be treated\n  as asynchronous\n  and passed\n  an additional function parameter,\n  `done`.\n  You must call `done`\n  when the action\n  is finished.\n* `fail`:\n  The error handler.\n  A function\n  that will be called\n  if `limit`\n  falsey values\n  are returned by\n  `when` or `until`.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `pass`:\n  Success handler.\n  A function\n  that will be called\n  after `until`\n  has returned\n  truthily.\n  If undefined,\n  it defaults to a function\n  defined as\n  `function () {}`.\n* `limit`:\n  Failure limit,\n  representing the number of times\n  that `when`\n  and `until`\n  may return a falsey value,\n  before the invocation\n  is deemed to have failed\n  and attempts\n  to call `action`\n  will cease.\n  A negative number\n  indicates that the attempt\n  should never fail,\n  instead continuing indefinitely\n  until `when`\n  and `until`\n  have returned\n  truthy values.\n  Defaults to -1.\n* `interval`:\n  A number\n  representing the\n  retry interval,\n  in milliseconds.\n  Use a negative number to indicate\n  that each subsequent retry\n  should wait for twice the interval\n  from the preceding iteration\n  (i.e. exponential incrementation).\n  The default value is\n  -1000,\n  signifying that\n  the initial retry interval\n  should be one second\n  and that each subsequent retry\n  should double\n  the previous interval.\n* `context`:\n  The context object\n  (i.e. `this`)\n  on which to invoke\n  the functions\n  `when`,\n  `until`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty object.\n* `args`:\n  The arguments array\n  that will be provided\n  to the functions\n  `when`,\n  `action`,\n  `fail` and\n  `pass`.\n  Defaults to\n  an empty array.\n\nExamples:\n```javascript\n// Attempt to insert a database record, waiting until a\n// connection is available before doing so. The retry\n// interval is 1 second on each occasion and the call\n// will fail after 10 attempts.\ntrier.attempt({\n    when: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(record);\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    interval: 1000,\n    limit: 10\n});\n\n// Attempt to send an email message, optionally retrying with\n// exponentially increasing intervals starting at 1 second.\n// Continue to make attempts until the call succeeds.\nvar sent = false\ntrier.attempt({\n    until: function () {\n        return sent;\n    },\n    action: function (done) {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n            }\n            done();\n        });\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## How do I set up the build environment?\n\nThe build environment relies on\nNode.js,\nNPM,\n[JSHint],\n[CoffeeScript],\n[Mocha],\n[Chai],\n[spooks.js][spooks] and\n[UglifyJS].\nAssuming that you already have\nNode.js\nand NPM\ninstalled,\nyou just need to run\n`npm install`\nto set up all of the dependencies\nas listed in `package.json`.\n\nThe unit tests are in `test/trier.coffee`.\nYou can run them with the command `npm test`.\n\n## What license is trier.js released under?\n\n[MIT][license]\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[npm]: https://npmjs.org/\n[jam]: http://jamjs.org/\n[component]: http://component.io/\n[bower]: http://bower.io/\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[coffeescript]: http://coffeescript.org/\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[spooks]: https://github.com/philbooth/spooks.js\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n\n","readmeFilename":"README.md","_id":"trier@0.3.6","dist":{"shasum":"61a80f44f8d7a24704f7628ada70c2c79325667d","tarball":"https://registry.npmjs.org/trier/-/trier-0.3.6.tgz","integrity":"sha512-KsKEcXdY56BO5eW7V/KA4HEKhqAyxkCs3yMbD1TxHS4VAf0ruNoMSIxi+VODHbdeqT+1hrpIeY2tSatmbr8TlA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGhVD6QyawMrAr90gekDE58Dqw/d+RVOmtswxAJDUHjyAiAb2XHzytbAmZTWYp4xSDyJ/6PO0VZaP+qMBkSSgDUkvw=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"philbooth","email":"pmbooth@gmail.com"},"maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"deprecated":"Alas, trier is dead. Rest in peace, trier. But worry not! A phoenix rises from the flames; perhaps you should look at `tryer` instead!"}},"readme":"# trier.js\n\n[![Build status][ci-image]][ci-status]\n\nBecause everyone loves a trier!\nConditional\nand repeated\ntask invocation\nfor node\nand browser.\n\n## License\n\n[MIT][license]\n\n## Installation\n\n### Via NPM\n\n```\nnpm install trier\n```\n\n### Via Jam\n\n```\njam install trier\n```\n\n### Via Git\n\n```\ngit clone git@github.com:philbooth/trier.js.git\n```\n\n## Usage\n\n### Loading the library\n\nBoth\nCommonJS\n(e.g.\nif you're running on [Node.js][node]\nor if you're in the browser with [Browserify])\nand AMD\n(e.g. if you're using [Require.js][require])\nloading styles are supported.\nIf neither system is detected,\nthe library defaults to\nexporting it's interface globally\nas `trier`.\n\n### Calling the library\n\ntrier.js exports two public functions,\n`when` and `until`.\n\n#### trier.when (options)\n\nPerforms some action\nwhen prerequesite conditions\nare met.\n\nAccepts a single options object,\nwhich supports the following properties:\n\n* `predicate`: Callback function used to test precondition.\n  Should return `false` to postpone `action` or `true` to perform it.\n  Defaults to nop.\n* `action`: The function you want to call. Defaults to nop.\n* `fail`: Callback function to be invoked if `limit` tries are reached.\n  Defaults to nop.\n* `context`: Context object used when applying `predicate`, `action` and `fail`.\n  Defaults to `{}`.\n* `args`: Arguments array used when applying `predicate`, `action` and `fail`.\n  Defaults to `[]`.\n* `interval`: Retry interval in milliseconds.\n  Use negative numbers to indicate that subsequent retries should wait for twice the preceding interval\n  (i.e. exponential waits).\n  Defaults to -1000.\n* `limit`: Maximum retry count, at which point the call fails and retry iterations cease.\n  Use a negative number to indicate that call should continue indefinitely\n  (i.e. never fail).\n  Defaults to -1.\n\nExample:\n```javascript\ntrier.when({\n    predicate: function () {\n        return db.isConnected;\n    },\n    action: function () {\n        db.insert(user);\n    },\n    fail: function () {\n        log.error('No database connection, terminating.');\n        process.exit(1);\n    },\n    pass: function () {\n        next();\n    },\n    interval: 1000,\n    limit: 10\n});\n```\n\n#### trier.until (options)\n\nPerforms some action repeatedly\nuntil postrequisite conditions\nare met.\n\nAccepts a single options object,\nwhich supports the following properties:\n\n* `predicate`: Callback function used to test postcondition.\n  Should return `false` to retry `action` or `true` to stop it.\n  Defaults to nop.\n* `action`: The function you want to call. Defaults to nop.\n* `fail`: Callback function to be invoked if `limit` tries are reached.\n  Defaults to nop.\n* `context`: Context object used when applying `predicate`, `action` and `fail`.\n  Defaults to `{}`.\n* `args`: Arguments array used when applying `predicate`, `action` and `fail`.\n  Defaults to `[]`.\n* `interval`: Retry interval in milliseconds.\n  Use negative numbers to indicate that subsequent retries should wait for twice the preceding interval\n  (i.e. exponential waits).\n  Defaults to -1000.\n* `limit`: Maximum retry count, at which point the call fails and retry iterations cease.\n  Use a negative number to indicate that call should continue indefinitely\n  (i.e. never fail).\n  Defaults to -1.\n\nExample:\n```javascript\nvar sent = false\ntrier.until({\n    predicate: function () {\n        return sent;\n    },\n    action: function () {\n        smtp.send(email, function (error) {\n            if (!error) {\n                sent = true;\n            }\n        });\n    },\n    pass: function () {\n        next();\n    },\n    interval: -1000,\n    limit: -1\n});\n```\n\n## Development\n\n### Dependencies\n\nThe build environment relies on\nNode.js,\n[NPM],\n[JSHint],\n[Mocha],\n[Chai] and\n[UglifyJS].\nAssuming that you already have Node.js and NPM set up,\nyou just need to run `npm install`\nto install all of the dependencies as listed in `package.json`.\n\n### Unit tests\n\nThe unit tests are in `test/trier.js`.\nYou can run them with the command `npm test` or `jake test`.\nTo run the tests in a web browser,\nopen `test/trier.html`.\n\n[ci-image]: https://secure.travis-ci.org/philbooth/trier.js.png?branch=master\n[ci-status]: http://travis-ci.org/#!/philbooth/trier.js\n[license]: https://github.com/philbooth/trier.js/blob/master/COPYING\n[node]: http://nodejs.org/\n[browserify]: http://browserify.org/\n[require]: http://requirejs.org/\n[npm]: https://npmjs.org/\n[jshint]: https://github.com/jshint/node-jshint\n[mocha]: http://visionmedia.github.com/mocha\n[chai]: http://chaijs.com/\n[uglifyjs]: https://github.com/mishoo/UglifyJS\n\n","maintainers":[{"name":"philbooth","email":"pmbooth@gmail.com"}],"time":{"modified":"2022-06-27T21:18:40.357Z","created":"2013-09-17T22:00:37.385Z","0.1.0":"2013-09-17T22:00:43.028Z","0.2.0":"2013-09-21T23:42:45.530Z","0.2.1":"2013-09-21T23:57:21.670Z","0.3.0":"2013-09-22T10:30:03.859Z","0.3.1":"2013-09-23T08:25:10.824Z","0.3.2":"2013-09-25T12:52:40.249Z","0.3.3":"2013-09-25T13:06:44.587Z","0.3.4":"2013-10-12T16:56:20.309Z","0.3.5":"2013-10-27T21:40:19.077Z","0.3.6":"2013-12-01T21:53:57.333Z"},"author":{"name":"Phil Booth","email":"pmbooth@gmail.com","url":"https://github.com/philbooth"},"repository":{"type":"git","url":"https://github.com/philbooth/trier.js.git"}}