{"name":"array-move","version":"0.1.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":"e42d29f1e7f24374c40517ae960cc75d5d98c34d","bugs":{"url":"https://github.com/sindresorhus/array-move/issues"},"homepage":"https://github.com/sindresorhus/array-move","_id":"array-move@0.1.0","_shasum":"8871ff26bcd3284b0e00739e0158390d6c18f9f9","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"8871ff26bcd3284b0e00739e0158390d6c18f9f9","tarball":"http://registry-npm.ywwl.com/array-move/download/array-move-0.1.0.tgz","integrity":"sha512-siJpiTiicKHeJTi58GlmW5hPr3bDPpuvPeXRR18tycNHspqcFHuQTuDK33afPfEBrjy21jcQ8wA/yIvkFWYV5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXzbPfZwcMjzgzrs02w+NrFW0eMoh3bAzPELX33JL+RAiAz1ZoVcGFex4u39gT98WomgJy6YF2sDJ9WuSo8Ktz2AQ=="}],"size":1630,"noattachment":false,"key":"/array-move/-/array-move-0.1.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":1441385447753,"_cnpm_publish_time":1441385447753,"dist-tags":{"latest":"4.0.0"}}