{"name":"array-move","version":"1.0.0","description":"Move an array item to a different position","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/array-move"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["array","arr","move","change","position","index"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"2246727d5cbf86d682a7cf62c876f89eb29c3cb2","bugs":{"url":"https://github.com/sindresorhus/array-move/issues"},"homepage":"https://github.com/sindresorhus/array-move","_id":"array-move@1.0.0","_shasum":"ec5de472cab0b9db3e50963fd71476ba477a6583","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"ec5de472cab0b9db3e50963fd71476ba477a6583","tarball":"http://registry-npm.ywwl.com/array-move/download/array-move-1.0.0.tgz","integrity":"sha512-VQg4inzztZ6D1CuMWLIvo6KE20t8z5vZok4SgRXlkeG9m+MtrBG/z5Ru/k5zS1vw/fchfOx88tuxZEdUCtBlCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE7hbix+TeVjsHzcrtP1nMgZS/jv4poIyGElxCBojJ/SAiA1BF/ezLm31Qdwo169BQwhDiOT2tEJ16/aNhTIMED12w=="}],"size":1665,"noattachment":false,"key":"/array-move/-/array-move-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"readme":"# array-move\n\n> Move an array item to a different position\n\n## Install\n\n```\n$ npm install array-move\n```\n\n## Usage\n\n```js\nimport {arrayMoveImmutable} from 'array-move';\n\nconst input = ['a', 'b', 'c'];\n\nconst array1 = arrayMoveImmutable(input, 1, 2);\nconsole.log(array1);\n//=> ['a', 'c', 'b']\n\nconst array2 = arrayMoveImmutable(input, -1, 0);\nconsole.log(array2);\n//=> ['c', 'a', 'b']\n\nconst array3 = arrayMoveImmutable(input, -2, -3);\nconsole.log(array3);\n//=> ['b', 'a', 'c']\n```\n\n## API\n\n### arrayMoveImmutable(array, fromIndex, toIndex)\n\nClones the given `array`, moves the item to a new position in the new array, and then returns the new array. The given `array` is not mutated.\n\n### arrayMoveMutable(array, fromIndex, toIndex)\n\nMoves the item to the new position in the `array` array. Useful for huge arrays where absolute performance is needed.\n\n#### array\n\nType: `Array`\n\n#### fromIndex\n\nType: `number`\n\nThe index of item to move.\n\nIf negative, it will begin that many elements from the end.\n\n#### toIndex\n\nType: `number`\n\nThe index of where to move the item.\n\nIf negative, it will begin that many elements from the end.\n","publish_time":1441680157857,"_cnpm_publish_time":1441680157857,"dist-tags":{"latest":"4.0.0"}}