{"_id":"@andersaloof/next-step","_rev":"1-aa9f04174975d1551a70675dc2197d58","name":"@andersaloof/next-step","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@andersaloof/next-step","description":"Steps an integer by a specified amount (+ or -), within a range from 0 to max, wrapping when the new value exceeds the range.","version":"1.0.0","main":"index.js","browser":"index.js","dependencies":{},"devDependencies":{"tape":"~4.9.1"},"scripts":{"test":"node test"},"author":{"name":"Anders S. Øfsdahl","email":"anders@aloof.no","url":"http://github.com/andersaloof"},"license":"MIT","repository":{"type":"git","url":"git://github.com/andersaloof/next-step.git"},"bugs":{"url":"https://github.com/andersaloof/next-step/issues"},"keywords":["next","step","prev"],"homepage":"https://github.com/andersaloof/next-step#readme","_id":"@andersaloof/next-step@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"andersaloof","email":"npm@aloof.no"},"dist":{"integrity":"sha512-zZ6GkDfHhuJYvsVBKShS3SwXqLlQaKeC/+dmFFU4qIuMdhRacyx3aHZdmdXBMxwP9FgPe2iKJ0LMrgg3YatE8g==","shasum":"3524cdee0e14303f95a1cd4383eb009955f13dbe","tarball":"https://registry.npmjs.org/@andersaloof/next-step/-/next-step-1.0.0.tgz","fileCount":5,"unpackedSize":3881,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdsd3CRA9TVsSAnZWagAApGAQAJ7wqUPDWywcCZpAL+yV\nkEwLazww9vOdYoL4N3Lsj+Sq55ESllnFaZzghmSz5nnU8ClzHNv2ojN6O0O3\nluYfM++YtqH8BQXjzTmKVui2O68NgHYWdLyp2BeV4d8jxxqjEUlUK5eH6t3O\npA3L4OgMzvXLPBFfjLfoHnqYid31Bld6NrjQZtXArfHEd1Z9RXdF51fSEdUm\nARtQzsAFqKJetfsQ0GV1DEk0DbUZvH6DmCLSRjvnJqx0zLwfOcEm4SawM3jy\nNRdm3rAyXh0XzEZcCGFm3evhuLBRo+uQPX/L2Y+0mqP7dPVQWeIkQSREylax\nDq1qipBoWweIVdBSCrnXRVEDiljRAZd8JWHRFiCx/zIDvDEFKENUYELTH7P1\nvhK7Hsg4POrH/KDMohQNnXR4pw82/jWXfaWm55z825f2h0DMk8EfKPcT0EdA\niU1/vW4fb0UsPwKTVUm4UkLAUF1cJYwwvAsCnl7Xm7KyxsEh5af7tKHqLLGc\nN1OQuiuwk+KNner+XD2hcAGYQjkvxLqnKB14ZKTaBN/Dtiduf9nhmv42CKgB\ndNX2NlvFyxAXrGg6PCsQVMu/M+f3k2E5ak9LB9gDDLjtPrCxGOL89Lh0zGmQ\nVlusaXi43eitEnjLqd07fgC7+ZiJDV7PzSl2OuN87c9hIHuXXWQLc4QK/2JT\nIHP7\r\n=vyPj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID/RbdWdSGSyO0R6t5dJmtMgRB8iVoqbITO1YU7s5mKfAiBERKd8K7OoR060a/MuNe2Gpq6ibT7mOZ7vVA9TgWAzBg=="}]},"maintainers":[{"name":"andersaloof","email":"npm@aloof.no"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-step_1.0.0_1534510966628_0.9725444518546971"},"_hasShrinkwrap":false}},"time":{"created":"2018-08-17T13:02:46.218Z","1.0.0":"2018-08-17T13:02:46.741Z","modified":"2022-04-04T13:57:45.353Z"},"maintainers":[{"name":"andersaloof","email":"npm@aloof.no"}],"description":"Steps an integer by a specified amount (+ or -), within a range from 0 to max, wrapping when the new value exceeds the range.","homepage":"https://github.com/andersaloof/next-step#readme","keywords":["next","step","prev"],"repository":{"type":"git","url":"git://github.com/andersaloof/next-step.git"},"author":{"name":"Anders S. Øfsdahl","email":"anders@aloof.no","url":"http://github.com/andersaloof"},"bugs":{"url":"https://github.com/andersaloof/next-step/issues"},"license":"MIT","readme":"# nextStep [![Build Status](https://travis-ci.org/andersaloof/next-step.svg?branch=master)](https://travis-ci.org/andersaloof/next-step)\n\nSteps an integer by a specified amount (+ or -), within a range from 0 to max, wrapping when the new value exceeds the range.\n\n## Install\n\n```\n$ npm install @andersaloof/next-step\n```\n\n## Why?\n\nHaving made similar logic in a dozen of slideshows/galleries over the years, handling previous and next buttons to increase/decrease a current index, it was time to move it out to a separate module.\n\n## Usage\n\n**`nextStep(current, max, value)`**\n\n\n### Example code\n\n```js\nconst nextStep = require('@andersaloof/next-step');\n\nconst nextValue = nextStep(1, 5, 2); // Increase current value 1 by 2, returns 3;\nconst anotherValue = nextStep(1, 5, -3); // Decrease current value 1 by -3, with a max value of 5, returns 4;\n```\n\n## License\n\nMIT. See LICENSE.md for details.\n","readmeFilename":"README.md"}