{"_id":"@cjser/to-rotated","name":"@cjser/to-rotated","dist-tags":{"latest":"1.0.0-cjser.2"},"versions":{"1.0.0-cjser.2":{"name":"@cjser/to-rotated","version":"1.0.0-cjser.2","description":"Rotate an array by a given number of steps","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.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","require":"./dist-cjser/index.cjs","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"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"1.0.0","cjserVersion":2,"original":{"name":"to-rotated","version":"1.0.0","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/to-rotated","files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava"}}},"_id":"@cjser/to-rotated@1.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-o+uQUFNMVj74pYSFngCoR7+Od0Smfw4Za6zegmiJAn2lT3SSKP8WSpMVhhjNz5FJcBu1K3RT8rEVBkdwBdBbaA==","shasum":"df9ecfdbfae03b9e75b33a5ca234c28dda7f4c18","tarball":"https://registry.npmjs.org/@cjser/to-rotated/-/to-rotated-1.0.0-cjser.2.tgz","fileCount":6,"unpackedSize":6054,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID+lbfRXJaEPgcVp/wabAZsnuAfBWQUq39xStYaVZpPBAiEAoMR3ib2faXkw5QjblOsRfd3W/reT/SDi8MiZ/pbifLk="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/to-rotated_1.0.0-cjser.2_1778160401781_0.21510778198824343"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:26:41.693Z","1.0.0-cjser.2":"2026-05-07T13:26:42.028Z","modified":"2026-05-07T13:26:42.237Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Rotate an array by a given number of steps","keywords":["array","rotate","rotation","rotated","shift","immutable","steps","cycle","cycling","cycled","move"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/to-rotated\n","readmeFilename":"readme.md","_rev":"1-9243db5afb04cb964d976667171b3c44"}