{"_id":"to-rotated","name":"to-rotated","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"to-rotated","version":"1.0.0","description":"Rotate an array by a given number of steps","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/to-rotated.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["array","rotate","rotation","rotated","shift","immutable","steps","cycle","cycling","cycled","move"],"devDependencies":{"ava":"^6.1.3","xo":"^0.58.0"},"_id":"to-rotated@1.0.0","gitHead":"60f6e0002b0a2d649bb2e24002c54bb48ac118ce","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/to-rotated/issues"},"homepage":"https://github.com/sindresorhus/to-rotated#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"integrity":"sha512-KsEID8AfgUy+pxVRLsWp0VzCa69wxzUDZnzGbyIST/bcgcrMvTYoFBX/QORH4YApoD89EDuUovx4BTdpOn319Q==","shasum":"cdf13ece5203e72384a79020508ae1dc80d3b48f","tarball":"https://registry.npmjs.org/to-rotated/-/to-rotated-1.0.0.tgz","fileCount":5,"unpackedSize":3537,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICKsajz0pDwVa1zCTbKCBIvgmLIgg2h2TqRXIPwMNaLGAiEArEaU8lW30WySrvcLOxcP9BZdGtdwMWW8gduYAETwMFM="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/to-rotated_1.0.0_1716399086575_0.41139350361903393"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-22T17:31:26.574Z","1.0.0":"2024-05-22T17:31:26.733Z","modified":"2024-05-22T17:31:26.978Z"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"description":"Rotate an array by a given number of steps","homepage":"https://github.com/sindresorhus/to-rotated#readme","keywords":["array","rotate","rotation","rotated","shift","immutable","steps","cycle","cycling","cycled","move"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/to-rotated.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/to-rotated/issues"},"license":"MIT","readme":"# to-rotated\n\n> Rotate an array by a given number of steps\n\nArray rotation shifts the elements left or right by a certain number of steps. Elements that move past the end reappear at the beginning. For example, rotating `[1, 2, 3, 4, 5]` by 2 steps to the right results in `[4, 5, 1, 2, 3]`.\n\n## Install\n\n```sh\nnpm install to-rotated\n```\n\n## Usage\n\n```js\nimport toRotated from 'to-rotated';\n\nconsole.log(toRotated([1, 2, 3, 4, 5], 2));\n//=> [4, 5, 1, 2, 3]\n\nconsole.log(toRotated([1, 2, 3, 4, 5], -2));\n//=> [3, 4, 5, 1, 2]\n```\n\n## API\n\n### toRotated(array, steps)\n\nReturns a new array that is rotated by the given number of steps.\n","readmeFilename":"readme.md"}