{"_id":"poem-loop","_rev":"15-f4aa3a23715631dd1256d25ec1ba497e","name":"poem-loop","description":"A requestAnimationFrame loop for visualizations, demos, experiments, art, and poems.","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"poem-loop","version":"1.0.0","description":"A requestAnimationFrame loop for visualizations, demos, experiments, art, and poems.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tatumcreative/poem-loop/"},"keywords":["requestAnimationFrame","visualizations","games","art","poems","loop","game loop"],"author":{"name":"Greg Tatum"},"license":"MIT","dependencies":{"events":"^1.0.2","lodash":"^2.4.1","raf":"^2.0.4"},"gitHead":"584d029a127515ebcd9cfb4134662d0a1151f21e","_id":"poem-loop@1.0.0","_shasum":"af77bdde2a161b5aad6fef8f6b3cdf10f27bf06b","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.30","_npmUser":{"name":"tatumcreative","email":"tatum.creative@gmail.com"},"maintainers":[{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"dist":{"shasum":"af77bdde2a161b5aad6fef8f6b3cdf10f27bf06b","tarball":"https://registry.npmjs.org/poem-loop/-/poem-loop-1.0.0.tgz","integrity":"sha512-H+xXG4+OYJMCJrJxp2EH418bfqiJsE73MCqRUcXa8Sow71tUIH8rKivMqnbUNvyjgEWzljnFNxCg/S3Drfp4aw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDiWYWyvTu0xWYhdJT/EIuk3VgU3vVvUs98yno9ay5szAiB/SGj+8gGG3jLZBmeivANar8+NOSFbXpZI79VY2Y3Cdg=="}]}},"1.0.1":{"name":"poem-loop","version":"1.0.1","description":"A requestAnimationFrame loop for visualizations, demos, experiments, art, and poems.","main":"lib/loop.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tatumcreative/poem-loop/"},"keywords":["requestAnimationFrame","visualizations","games","art","poems","loop","game loop"],"author":{"name":"Greg Tatum"},"license":"MIT","dependencies":{"events":"^1.0.2","lodash":"^2.4.1","raf":"^2.0.4"},"gitHead":"10d18f5fbc22bd620ccf313e7abc990ae662125f","_id":"poem-loop@1.0.1","_shasum":"87bd4be29368c934e420c46e137943a662bf9d61","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.30","_npmUser":{"name":"tatumcreative","email":"tatum.creative@gmail.com"},"maintainers":[{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"dist":{"shasum":"87bd4be29368c934e420c46e137943a662bf9d61","tarball":"https://registry.npmjs.org/poem-loop/-/poem-loop-1.0.1.tgz","integrity":"sha512-7ZCy9slnkUS7bvBp9alu9c0yy537bl5f0Lv8GR4L3Z25IRp6CD9Z/ZuVHp/nBUTYt/pkaAjQnyK1M+ajC3WPcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmLzcuyDn/Ex2mbRz4cym2oHY/pBIAAOqBQAnIZTUKZAIga1Hc+FG9XmG8u6esFL1vz7ZAJ/Ncd1dJZ1p8Cb563vo="}]}},"1.0.2":{"name":"poem-loop","version":"1.0.2","description":"A requestAnimationFrame loop for visualizations, demos, experiments, art, and poems.","main":"lib/loop.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tatumcreative/poem-loop/"},"keywords":["requestAnimationFrame","visualizations","games","art","poems","loop","game loop"],"author":{"name":"Greg Tatum"},"license":"MIT","dependencies":{"events":"^1.0.2","lodash":"^2.4.1","raf":"^2.0.4"},"gitHead":"c21416839b478d335c1b4fec98e95862031af73d","_id":"poem-loop@1.0.2","_shasum":"c55c65bb43160d250b10c14c0bc13f8c7cb08ec0","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.30","_npmUser":{"name":"tatumcreative","email":"tatum.creative@gmail.com"},"maintainers":[{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"dist":{"shasum":"c55c65bb43160d250b10c14c0bc13f8c7cb08ec0","tarball":"https://registry.npmjs.org/poem-loop/-/poem-loop-1.0.2.tgz","integrity":"sha512-RJnSXwgFMTiJY8Kmp6poOEQzjviR6FVaMVPgqkdONQewbPY4zWw5GcoFQTl0LAptkO1Q0KfN5CiqA9KHIy3BsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEWmY8Y4zy/cD7ZbqqSX25OFNAAwQCY5l+YxyDZbfrVvAiEAjgKI4jnF0EAhY+QaywjvF0eFwpKvGXCBXHlkG97RKV8="}]}},"1.0.3":{"name":"poem-loop","version":"1.0.3","description":"A requestAnimationFrame loop for visualizations, demos, experiments, art, and poems.","main":"lib/loop.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tatumcreative/poem-loop/"},"keywords":["requestAnimationFrame","visualizations","games","art","poems","loop","game loop"],"author":{"name":"Greg Tatum"},"license":"MIT","dependencies":{"events":"^1.0.2","lodash":"^2.4.1","raf":"^2.0.4"},"gitHead":"168fe95058588103f40bbe0ff95ed4823f6bcee5","_id":"poem-loop@1.0.3","_shasum":"760bf80dde1fc80499fca439c36dd05c74c67f58","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.30","_npmUser":{"name":"tatumcreative","email":"tatum.creative@gmail.com"},"maintainers":[{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"dist":{"shasum":"760bf80dde1fc80499fca439c36dd05c74c67f58","tarball":"https://registry.npmjs.org/poem-loop/-/poem-loop-1.0.3.tgz","integrity":"sha512-3hQJA0ERNYuTmU7JKM0BCka2vhO4TfVwsqvkPkuewcovZnCD1O0GMINlFvjhv5GtBsZCz7lL/6e9s9573wOmYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAcj0Muidjyapj0MNOxyVZ3xS++iVJrxErTPG/rCozXcAiEA7ssKgJoCN+FvqGQ+RjKqtE4fC2EJ2D9VM/HwKKbZxMo="}]}},"1.0.4":{"name":"poem-loop","version":"1.0.4","description":"A requestAnimationFrame loop for visualizations, demos, experiments, art, and poems.","main":"lib/loop.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tatumcreative/poem-loop/"},"keywords":["programming-poem","visualization","game","art","loop","requestAnimationFrame","game loop"],"author":{"name":"Greg Tatum"},"license":"MIT","dependencies":{"events":"^1.0.2","lodash":"^2.4.1","raf":"^2.0.4"},"gitHead":"56cece7be263addcbf4765e2041eb56ec97a8781","_id":"poem-loop@1.0.4","_shasum":"f565be29787becf2e44c3445b61cf0ca9718b3ba","_from":".","_npmVersion":"2.1.17","_nodeVersion":"0.10.35","_npmUser":{"name":"tatumcreative","email":"tatum.creative@gmail.com"},"maintainers":[{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"dist":{"shasum":"f565be29787becf2e44c3445b61cf0ca9718b3ba","tarball":"https://registry.npmjs.org/poem-loop/-/poem-loop-1.0.4.tgz","integrity":"sha512-VGgNy4t+QmZHzGCu44QbvHEoMePM5bgnhwoG/ywoi+9TYnXgCb1pvkWnzNDG4WfjN1daD283LkAtkqGM6stDYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxL9nCwo73BRNGUjwheCfzl//FzbzAsP1EuUo9uRSQ8gIgT2AR9onNnh9EUZ2XSu+HEkDEXks0iO0cIQ98ZCyxIAE="}]}},"1.0.5":{"name":"poem-loop","version":"1.0.5","description":"A requestAnimationFrame loop for visualizations, demos, experiments, art, and poems.","main":"lib/loop.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tatumcreative/poem-loop/"},"keywords":["programming-poem","visualization","game","art","loop","requestAnimationFrame","game loop"],"author":{"name":"Greg Tatum"},"license":"MIT","dependencies":{"events":"^1.0.2","lodash.assign":"^3.1.0","raf":"^2.0.4"},"gitHead":"4d0586f5cb9d20882c5b865c3a3c2a0eabdd6803","_id":"poem-loop@1.0.5","_shasum":"fd25bf577bd50e86caad93e6e121c3fc6d8f32ab","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"tatumcreative","email":"tatum.creative@gmail.com"},"maintainers":[{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"dist":{"shasum":"fd25bf577bd50e86caad93e6e121c3fc6d8f32ab","tarball":"https://registry.npmjs.org/poem-loop/-/poem-loop-1.0.5.tgz","integrity":"sha512-F6ngAhMq4HfnLEB4/YymxARL0aGKkjQuMpYNtRV0rP4SwNvsnIhwdxSqwSxDLQw/Kq+DBzz1ybFOkWBNy5/PpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICXT9U2ZhHaKHNEkDQw5yc9wR5Wu6fX8+/DO1ior5YlhAiEA/aGGVapBiXbepqP/F/N+KHVXgDCPcbyN9tzFky/3/gM="}]}},"1.1.0":{"name":"poem-loop","version":"1.1.0","description":"A requestAnimationFrame loop for visualizations, demos, experiments, art, and poems.","main":"lib/loop.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tatumcreative/poem-loop/"},"keywords":["programming-poem","visualization","game","art","loop","requestAnimationFrame","game loop"],"author":{"name":"Greg Tatum"},"license":"MIT","dependencies":{"events":"^1.0.2","lodash.assign":"^3.1.0","raf":"^2.0.4"},"gitHead":"0ef79642cbbd2b58faaba7f9df4e6571975aa3a3","_id":"poem-loop@1.1.0","_shasum":"9c83664faad14710413f527ef4a3a05a6899ea27","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"tatumcreative","email":"tatum.creative@gmail.com"},"maintainers":[{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"dist":{"shasum":"9c83664faad14710413f527ef4a3a05a6899ea27","tarball":"https://registry.npmjs.org/poem-loop/-/poem-loop-1.1.0.tgz","integrity":"sha512-Fl1HfXXDDM2ZG7i8G2edNXhcqO3XzgJ+IOUkJzEu85xne1yMGqY/l6QJPmgXTN9eAhFWm3wBe+1wNrD9izL2Nw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFig/15DdQNbaHPxZfiAK/3Zc9lCqI/ZPVhImVlkWWgOAiAa4cq40tNHM6Ly+/1q/AwPZI+/04Ei/zlGzRwUeZvrqg=="}]}},"1.1.1":{"name":"poem-loop","version":"1.1.1","description":"A requestAnimationFrame loop for visualizations, demos, experiments, art, and poems.","main":"lib/loop.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/tatumcreative/poem-loop/"},"keywords":["programming-poem","visualization","game","art","loop","requestAnimationFrame","game loop"],"author":{"name":"Greg Tatum"},"license":"MIT","dependencies":{"events":"^1.1.0"},"gitHead":"3d4e8430a4ef64be123d4e6865fb4d4a4a8c26a7","_id":"poem-loop@1.1.1","_shasum":"6210b29ee3432ce7a0525161557f1b16f817e866","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"tatumcreative","email":"tatum.creative@gmail.com"},"maintainers":[{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"dist":{"shasum":"6210b29ee3432ce7a0525161557f1b16f817e866","tarball":"https://registry.npmjs.org/poem-loop/-/poem-loop-1.1.1.tgz","integrity":"sha512-pLeTxMvKubNvFeu2RmLmDWmCeRDKxH/fhdx/Yq8ZskdidKrrzoPDm462aMTV8Z12fn4uFpoC6F108Fy+4+47OA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCI/9BCUYuSPCfurz+ZuQ8Knw2oagpqkm7qKkUzphaU3QIhANpwhNuK/5RzaQkOvoVLmpn3b3duBOlK5KPtjVg/JxNS"}]}}},"readme":"# poem-loop\n\nThis module is a configurable event loop for visualizations, demos, experiments, art, and poems. It provides an `update` and `draw` event, as well as `updatedone` and `drawdone`. It uses the [raf](https://www.npmjs.com/package/raf) module for the requestAnimationFrame.\n\nPart of the [programming-poem](https://www.npmjs.com/browse/keyword/programming-poem) module series.\n\n## Usage\n\nIts primary intended use is with [Browserify](http://browserify.org/).\n\nFrom the command line:\n\n\tnpm install poem-loop --save\n\nThen in your code:\n\n\tvar loop = require('poem-loop')( configuration );\n\t\n\tloop.start();\n\t\n\tloop.emitter.on('update', function( e ) {\n\t\tbox.position.x += e.dt;\n\t\tgameClock.text( e.elapsed );\n\t});\n\t\n\tloop.emitter.on('draw', function( e ) {\n\t\trenderer.render();\n\t});\n\t\n## Event object\n\nThe event object has the following values.\n\n * `dt` - The change in time in milliseconds.\n * `unitDt` - The change in time as a unit interval (0-1). Assumes 1 is equal to 16.6666 milliseconds.\n * `now` - The current Date.now() in milliseconds.\n * `elapsed` - The elapsed game time in milliseconds, starts at 0. Does not increment when the loop is stopped.\n\n## Configuration\n\nThe loop can be configured.\n\n\tvar loop = require('poem-loop')({\n\t\temitter: poemEmitter,\n\t\tcustomizeEvent : function( event ) {\n\t\t\tevent.mousePosition = getMousePosition();\n\t\t\treturn event;\n\t\t}\n\t});\n\n#### `emitter`\n\nA node.js EventEmitter. If one is set, it is used by the loop. Otherwise a new EventEmitter is created.\n\n#### `customizeEvent`\n\nA function that customizes the event object that is passed to the update and draw event. It gets passed the object and should return the object.\n\n## Interface\n\n#### `loop.start()`\n\nStart the loop.\n\n#### `loop.stop()`\n\nStops the loop but doesn't reset the elapsed time.\n\n#### `loop.reset()`\n\nResets the elapsed time.\n\n#### `loop.emitter`\n\nThe event emitter.","maintainers":[{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"time":{"modified":"2022-06-24T05:46:30.082Z","created":"2015-01-10T23:34:34.923Z","1.0.0":"2015-01-10T23:34:34.923Z","1.0.1":"2015-01-11T03:17:12.603Z","1.0.2":"2015-01-11T04:04:11.545Z","1.0.3":"2015-01-11T04:47:53.592Z","1.0.4":"2015-02-10T06:04:05.245Z","1.0.5":"2015-05-12T03:00:43.628Z","1.1.0":"2015-08-10T14:19:56.748Z","1.1.1":"2015-10-19T15:39:23.105Z"},"keywords":["programming-poem","visualization","game","art","loop","requestAnimationFrame","game loop"],"repository":{"type":"git","url":"https://github.com/tatumcreative/poem-loop/"},"author":{"name":"Greg Tatum"},"license":"MIT","readmeFilename":"README.md"}