{"_id":"string-replace-to-array","_rev":"11-b3a29e30fbde94405a8d7beb168e7c03","name":"string-replace-to-array","description":"Works like String.prototype.replace but outputs an array. Useful for replacing parts of the string with objects of other types.","dist-tags":{"latest":"2.1.1"},"versions":{"1.0.0":{"name":"string-replace-to-array","version":"1.0.0","keywords":["string","replace","array","react"],"author":{"name":"Oz Michaeli"},"license":"MIT","_id":"string-replace-to-array@1.0.0","maintainers":[{"name":"oztune","email":"oztune+npm@gmail.com"}],"dist":{"shasum":"ea1aad9c652a68eb9982fe98e367e870899299a7","tarball":"https://registry.npmjs.org/string-replace-to-array/-/string-replace-to-array-1.0.0.tgz","integrity":"sha512-R3e/TVKGOShHf89FrQDOsS0L0jRtxWrHQZUq3YPBEZzBwq9Ykgv5ZyFFoF9cgazayYm3Bg07mY7Zz7FhgYouzw==","signatures":[{"sig":"MEQCICgrRnn4f4/StUpy2rIdVMIz7b+fWMmyzxvsqk11OoQ6AiAM1BdGyH9fVRRQ5isqFMUv976GlEO7eARL75RyEjwOIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"string-replace-to-array.js","_from":".","_shasum":"ea1aad9c652a68eb9982fe98e367e870899299a7","gitHead":"eca95a5d78ec4a414c246a4d504496b2f73eb744","scripts":{"test":"mocha test.js"},"_npmUser":{"name":"oztune","email":"oztune+npm@gmail.com"},"_npmVersion":"3.8.3","description":"Works like String.prototype.replace but outputs an array. Useful for replacing parts of the string with objects of other types.","directories":{},"_nodeVersion":"5.10.1","dependencies":{"invariant":"^2.2.1","lodash.flatten":"^4.2.0","lodash.isarray":"^4.0.0","lodash.isstring":"^4.0.1"},"devDependencies":{"chai":"^3.5.0","mocha":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/string-replace-to-array-1.0.0.tgz_1461870785036_0.05170732457190752","host":"packages-12-west.internal.npmjs.com"}},"1.0.1":{"name":"string-replace-to-array","version":"1.0.1","keywords":["string","replace","array","react"],"author":{"name":"Oz Michaeli"},"license":"MIT","_id":"string-replace-to-array@1.0.1","maintainers":[{"name":"oztune","email":"oztune+npm@gmail.com"}],"homepage":"https://github.com/oztune/string-replace-to-array#readme","bugs":{"url":"https://github.com/oztune/string-replace-to-array/issues"},"dist":{"shasum":"206dfb78b9a43c2e7cce0d939b0afdc4761b2def","tarball":"https://registry.npmjs.org/string-replace-to-array/-/string-replace-to-array-1.0.1.tgz","integrity":"sha512-IWh+vXc1yGEzcBtOxcVx3nm+pN/6c6gYLhwX3C34vAgtoZYa0S+Wpv5P32e6InYSfi+qLzeVVS2+1t/NydZ7JQ==","signatures":[{"sig":"MEYCIQC2RhMJICaBPGrzNb9qTYFTJjcOA+iUtADRPsMJ7l1YAQIhAJ8NCFT2IR23GgEXwXA2wTxRio8LAbsgCQtGNEKl7id/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"string-replace-to-array.js","_from":".","_shasum":"206dfb78b9a43c2e7cce0d939b0afdc4761b2def","gitHead":"8512a903c4fd698aec100cdfa13b19525020e8a6","scripts":{"test":"mocha test.js"},"_npmUser":{"name":"oztune","email":"oztune+npm@gmail.com"},"repository":{"url":"git+https://github.com/oztune/string-replace-to-array.git","type":"git"},"_npmVersion":"3.8.3","description":"Works like String.prototype.replace but outputs an array. Useful for replacing parts of the string with objects of other types.","directories":{},"_nodeVersion":"5.10.1","dependencies":{"invariant":"^2.2.1","lodash.flatten":"^4.2.0","lodash.isarray":"^4.0.0","lodash.isstring":"^4.0.1"},"devDependencies":{"chai":"^3.5.0","mocha":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/string-replace-to-array-1.0.1.tgz_1461872565226_0.15362211759202182","host":"packages-12-west.internal.npmjs.com"}},"1.0.2":{"name":"string-replace-to-array","version":"1.0.2","keywords":["string","replace","array","react"],"author":{"name":"Oz Michaeli"},"license":"MIT","_id":"string-replace-to-array@1.0.2","maintainers":[{"name":"oztune","email":"oztune+npm@gmail.com"}],"homepage":"https://github.com/oztune/string-replace-to-array#readme","bugs":{"url":"https://github.com/oztune/string-replace-to-array/issues"},"dist":{"shasum":"e557bb5306f7005cad1869d730f0ee70d649b309","tarball":"https://registry.npmjs.org/string-replace-to-array/-/string-replace-to-array-1.0.2.tgz","integrity":"sha512-Qwq5ixq+2XGOFOBQbPMRmNxqih9A1Fme8btpqYtnlHH4ryWhLPpmT9ZBnIolxvR6gc720ZIhmoKAo4SV3RiAhg==","signatures":[{"sig":"MEYCIQDDgeGxlpprzdA24b25i9kAX2ho6JZYfz1Ke0vpVCMFcQIhAIx3ZBZJvvEigNDFNEUFGHnO2kSVBtaUKCmHpxSG5idN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"string-replace-to-array.js","_from":".","_shasum":"e557bb5306f7005cad1869d730f0ee70d649b309","gitHead":"d70b0ec29f115afb49c82497789c3aadc88186ee","scripts":{"test":"mocha test.js"},"_npmUser":{"name":"oztune","email":"oztune+npm@gmail.com"},"repository":{"url":"git+https://github.com/oztune/string-replace-to-array.git","type":"git"},"_npmVersion":"3.10.9","description":"Works like String.prototype.replace but outputs an array. Useful for replacing parts of the string with objects of other types.","directories":{},"_nodeVersion":"6.9.2","dependencies":{"invariant":"^2.2.1","lodash.flatten":"^4.2.0","lodash.isstring":"^4.0.1"},"devDependencies":{"chai":"^3.5.0","mocha":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/string-replace-to-array-1.0.2.tgz_1492417824429_0.1638529517222196","host":"packages-12-west.internal.npmjs.com"}},"1.0.3":{"name":"string-replace-to-array","version":"1.0.3","keywords":["string","replace","array","react"],"author":{"name":"Oz Michaeli"},"license":"MIT","_id":"string-replace-to-array@1.0.3","maintainers":[{"name":"oztune","email":"oztune+npm@gmail.com"}],"homepage":"https://github.com/oztune/string-replace-to-array#readme","bugs":{"url":"https://github.com/oztune/string-replace-to-array/issues"},"dist":{"shasum":"c93eba999a5ee24d731aebbaf5aba36b5f18f7bf","tarball":"https://registry.npmjs.org/string-replace-to-array/-/string-replace-to-array-1.0.3.tgz","integrity":"sha512-QIdKvmfXbdFvblXAAz6IIjR7A+C6SU6m2A+e7fE/0EYDC5yfeWNMJQ193fPsW7nG+9q52dv/UjnVrDaNVZXpmQ==","signatures":[{"sig":"MEYCIQDMSkKnk08OrzeCbB+WBg5j5werdXD43+f7ny5QIRSO+AIhAOFscsPF5iuGFgwQ+BPOrI++HYEI+8v9ciU8VlD7X9+W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"string-replace-to-array.js","_from":".","_shasum":"c93eba999a5ee24d731aebbaf5aba36b5f18f7bf","gitHead":"95b26e28551c3350fd49d1934351728341552852","scripts":{"test":"mocha test.js"},"_npmUser":{"name":"oztune","email":"oztune+npm@gmail.com"},"repository":{"url":"git+https://github.com/oztune/string-replace-to-array.git","type":"git"},"_npmVersion":"3.10.10","description":"Works like String.prototype.replace but outputs an array. Useful for replacing parts of the string with objects of other types.","directories":{},"_nodeVersion":"6.10.0","dependencies":{"invariant":"^2.2.1","lodash.flatten":"^4.2.0","lodash.isstring":"^4.0.1"},"devDependencies":{"chai":"^3.5.0","mocha":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/string-replace-to-array-1.0.3.tgz_1496697021533_0.5969866262748837","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"string-replace-to-array","version":"2.0.0","keywords":["string","replace","array","react","emoji"],"author":{"name":"Oz Michaeli"},"license":"MIT","_id":"string-replace-to-array@2.0.0","maintainers":[{"name":"oztune","email":"oztune+npm@gmail.com"}],"homepage":"https://github.com/appfigures/string-replace-to-array#readme","bugs":{"url":"https://github.com/appfigures/string-replace-to-array/issues"},"dist":{"shasum":"0e68c13582d664fef7be97b953a4989fde1a2855","tarball":"https://registry.npmjs.org/string-replace-to-array/-/string-replace-to-array-2.0.0.tgz","fileCount":7,"integrity":"sha512-+Lh1nRe4+ujjRljq3Q9apa/MMn+8aIkLv2/1YmB316dEIg51Ie+Z6rNShPSLwz3IQC4d1yfKzSp7rpM9eTZQzg==","signatures":[{"sig":"MEQCIFwHXIlF1fF3Q0gVsNl5oCKOmTCtZJ8JTYvTA3xJZ8knAiBX2VPGOcEBNAl5uXvy8T7UAWhJWo2nqYrLaGkUXxXlJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGyJwCRA9TVsSAnZWagAAt4MP/16irkYwMNVBhLyaGI1C\nerSgFE9T/4/W3mtaKj5f6tntyZMlpPbcfODCgPsiDjZsiCVieoef80RxX2K2\nJP3AkqWfdcbHENOsY1FMHiEyUcn5U4LOYs83/PiHz+1hiB9rMlRxMqRds3CW\nBJnrghjw86tqLuF7fQ63fwjxf6WZoM4/UdmP7g0yAAzTlIGLpQO+uurj1YJC\nZGdjDJIzZKHG7CMn2HMKUMbj/5BkJdISzhT2X7p2Le+C/12H7H+s0reLmK1+\nnR5HVuihfxd7s/wPIy8HDEyrPc3NxMuJYW/LmORWKV9weCwldtS2ZYv7VjGO\npFoFNd4br2keQAQcEOxgRXid5IkvMJRWKohGusWPOPlEeSFmTjwIg8dXrmHl\n4MljUnctQxkDbvly87Kx/Ri5pFgJ7TO3AlZgqxhmXJsJek1Dm/g+8ZpWzYG5\nly8pW3U3XYukX3DcTDN62rAaStFthr3PYAIObuEpZCzNTE6+TnKGY4TGLIiG\nMSJdDAXtVC6xGaD3OqtLmdKMyX92FfPxCt/Pt6USu0batGED5jl3wTDNgpiL\nl8REbGJ0orMGKsUXEaOUrhw3skK1XnYrnBtri3v66DjPjMKZBLfzrAGkDYAT\nUzAeXdnmyCuljkzJO2/j5pE0fO1R2nGQfXQBMUX6xZ2l8uTxeigq0F0gtls4\n9Wn4\r\n=96VZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"string-replace-to-array.js","gitHead":"c5fdd17cdc948a453840a513cb566f551bbeef22","scripts":{"test":"mocha test.js"},"_npmUser":{"name":"oztune","email":"oztune+npm@gmail.com"},"repository":{"url":"git+https://github.com/appfigures/string-replace-to-array.git","type":"git"},"_npmVersion":"6.14.4","description":"Works like String.prototype.replace but outputs an array. Useful for replacing parts of the string with objects of other types.","directories":{},"sideEffects":"false","_nodeVersion":"12.17.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.0.3"},"_npmOperationalInternal":{"tmp":"tmp/string-replace-to-array_2.0.0_1629168240820_0.9468928660426863","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"string-replace-to-array","version":"2.0.1","keywords":["string","replace","array","react","emoji"],"author":{"name":"Oz Michaeli"},"license":"MIT","_id":"string-replace-to-array@2.0.1","maintainers":[{"name":"oztune","email":"oztune+npm@gmail.com"}],"homepage":"https://github.com/appfigures/string-replace-to-array#readme","bugs":{"url":"https://github.com/appfigures/string-replace-to-array/issues"},"dist":{"shasum":"7d6fe409df6e298ba6fc78886f38bc6aa424738b","tarball":"https://registry.npmjs.org/string-replace-to-array/-/string-replace-to-array-2.0.1.tgz","fileCount":8,"integrity":"sha512-GmTi3KyGdvSncJRKuuAeCSUFAdUarUc75f7DF17VhQzX2pEOD1269NfMNcIZy4HoxGJxArafOJEUgzecvNdEzQ==","signatures":[{"sig":"MEUCIQDdCRgHeUJ0Ji9hgzMAUbEZxfNJs3My+9S+5UzNuYxQ2QIgHE8KfwuTNUqYboHA/v6v7eE3+um0CRupJU2jovWLYPY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHQ9PCRA9TVsSAnZWagAAaS0QAJ5ukm8ioVHLNfcD5JTy\npLNBp7PLRQF6gD8wlHtnT79qcYy5SKDMDpOn5uI6pdJ5fuXMQVpwX47dFa9J\nLKdG5dxcVOV9pvaTC67xYxlL6Pyn7O64oJAxawZX60n1yEKf/kaSiOGs9rjb\nevw05KN/bq1hnOHfD+CyCCnJ/k4GX1ez8SrAHyPw2GqDvxolH9EdtwGrqMzz\nOdEcqbWIhTR/DS2zw8aWyiacXXHHcJwLID0IRPTdZ+n6hq5+oTlc2fHOx09s\n93tgLhmdJdVbmdGGJ7JhiiAfR49bJoxqjeiloiRx39ks/LWBK5QmHElsPYtY\niXP2tvVl8N5p5RbBxhCGJp4kGc9IIYNzoP3exgSwCVeaNwpQUgjORgMcm1Jw\nx834Ydulwj2296XuCAk2JNyevLHJQ4V3KZm02fcj0moHDECXV11r2A1kTsw/\niO5djgOtW4llbJcL3kozDVnzCvB7vHsnriJCEp2il/lTgyI0nzjSkr4ojUhZ\nxENGI4MtqjFcmcYRyB+hWbFxF4KuCXXSMr9+POTf6AuqlOWHsRwQb54u3AML\ntynsjDnGOzt4pwCg1R0JEjgspcHJV7WBPwI7hiU87k+//KGyqHARu2EXhe77\n4uJxZNBKVxN2Yr6KHDfCwZOWfSEvP1Bls/+KBnVRKUJ3SPFoP3LZYziWFgav\n983n\r\n=CO8t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"string-replace-to-array.js","gitHead":"85bd42b636885bc4a1eb4a2bc6e3e92ffdcd43d6","scripts":{"test":"mocha test.js"},"_npmUser":{"name":"oztune","email":"oztune+npm@gmail.com"},"repository":{"url":"git+https://github.com/appfigures/string-replace-to-array.git","type":"git"},"_npmVersion":"6.14.4","description":"Works like String.prototype.replace but outputs an array. Useful for replacing parts of the string with objects of other types.","directories":{},"sideEffects":"false","_nodeVersion":"12.17.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.0.3"},"_npmOperationalInternal":{"tmp":"tmp/string-replace-to-array_2.0.1_1629294415761_0.8092262733635605","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"string-replace-to-array","version":"2.1.0","keywords":["string","replace","array","react","emoji"],"author":{"name":"Oz Michaeli"},"license":"MIT","_id":"string-replace-to-array@2.1.0","maintainers":[{"name":"oztune","email":"oztune+npm@gmail.com"}],"homepage":"https://github.com/appfigures/string-replace-to-array#readme","bugs":{"url":"https://github.com/appfigures/string-replace-to-array/issues"},"dist":{"shasum":"44571dbd33a3e23de31db948b5b84f1b7913fb39","tarball":"https://registry.npmjs.org/string-replace-to-array/-/string-replace-to-array-2.1.0.tgz","fileCount":8,"integrity":"sha512-xG2w4fE5FsTXS4AFxoF3uctByqTIFBX8lFRNcPcIznTVCMXbYvbatkPVLpAo13tfuWtzbWEV6u5bjoE9bOv87w==","signatures":[{"sig":"MEUCIH8OT/vDDsuN6MGWFFRdI0W/R/PAJFTUbTLcNVHwV72mAiEA6uowfQjNZUsSR9H/DTWsJ/RIbOoVavKdBwyo8HTrAO8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJHjNCRA9TVsSAnZWagAAuGsP/iP7AE2De4c06Bgj5GPh\njNgB5e0JuWpYhrjHNyYEl+xwduQoE+Frmqw82Te9CjxBS7sU+May8rP1HZwg\neTlrKNKD/R0qCl9Gdf2xA99XCOdKPZV11I6cr+dgH3k5XvfEb2EKNeIbbkAw\nPJq+BLARK9/NolvvludurgkBV7Ij+I1DgPeRZZ2J0WFP22uSC1nMy8GLi9rK\nZQaewE0UMLLMuiVcpZqKKkwdBfVZUj0jBmOqlGjq3j2doZz2feGbfB3f00CZ\nTb+/66LC+2k/QCJY1xtqkcorKQ+8xrPCazWukqMCx2Nh0oXWHHxkO4BU6nkL\nL5aYg9Et3oGVCXIAhGbGVtdmLm8RdCiuJtLpFNSAItd6O5d2qJyQQL90Td+p\nuDlY5oDcvod/PHwDkHIgFud/z4avMJ3Mch79ISiLwHpBGCs7oE8A+n7Nqn5e\nI/07XM+1KbaC8cNE4tPW3YlYrVshj1LvDrAtLU5+wyufa8nGcgWfrW+UVle0\nYOnQOKJI4ul4hJVT5XwpaRg0VCCg3uMCiUhhMdSPFqSSibNLKPsvJ6TXeYJB\nd2aq0xeb/j1JHRvPQtXqmzrwjbFaNiy+sJ1K60PLlMejqRnJpUsTMzWCPc5R\nA+koS1BSDQ6M40JPQYF6wyAzrdq3mrd17UFyKLmtw03Nhr5Q/ZptxNhX00x8\nT9I1\r\n=QmXf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"string-replace-to-array.js","gitHead":"7722e3df4bb82af0c327c93ed6bc1a7b82c04567","scripts":{"test":"mocha test.js"},"_npmUser":{"name":"oztune","email":"oztune+npm@gmail.com"},"repository":{"url":"git+https://github.com/appfigures/string-replace-to-array.git","type":"git"},"_npmVersion":"6.14.4","description":"Works like String.prototype.replace but outputs an array. Useful for replacing parts of the string with objects of other types.","directories":{},"sideEffects":"false","_nodeVersion":"12.17.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.0.3"},"_npmOperationalInternal":{"tmp":"tmp/string-replace-to-array_2.1.0_1629780173231_0.822119575498752","host":"s3://npm-registry-packages"}},"2.1.1":{"name":"string-replace-to-array","version":"2.1.1","description":"Works like String.prototype.replace but outputs an array. Useful for replacing parts of the string with objects of other types.","main":"string-replace-to-array.js","repository":{"type":"git","url":"git+https://github.com/appfigures/string-replace-to-array.git"},"bugs":{"url":"https://github.com/appfigures/string-replace-to-array/issues"},"scripts":{"test":"mocha test.js"},"keywords":["string","replace","array","react","emoji"],"sideEffects":false,"author":{"name":"Oz Michaeli"},"license":"MIT","devDependencies":{"chai":"^4.3.4","mocha":"^9.0.3"},"_id":"string-replace-to-array@2.1.1","gitHead":"64bd8cd4e04ff68bfc39d2e6d2bb67676e6a291e","types":"./string-replace-to-array.d.ts","homepage":"https://github.com/appfigures/string-replace-to-array#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-i31csTEoIrcB8pusAF72Z0WsF04sbdiH4s0egpcmFj30SgHYdYd1swmZ7Zb1qFryJ5DbZR6z4rSjOzoUcrWUWw==","shasum":"93aef1530d269721f0022e53a503a7ec8b2076a2","tarball":"https://registry.npmjs.org/string-replace-to-array/-/string-replace-to-array-2.1.1.tgz","fileCount":8,"unpackedSize":12638,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID64pEy6nT7CdHXF8aIwwIc3j3+CqQ9cy858zvJYB2X5AiAwUsMs0NcsfIc19bAoziFXYthJKHKsPYwjMM0b4UNNKw=="}]},"_npmUser":{"name":"oztune","email":"oztune+npm@gmail.com"},"directories":{},"maintainers":[{"name":"oztune","email":"oztune+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/string-replace-to-array_2.1.1_1717200525604_0.9195902625319992"},"_hasShrinkwrap":false}},"time":{"created":"2016-04-28T19:13:07.583Z","modified":"2024-06-01T00:08:45.934Z","1.0.0":"2016-04-28T19:13:07.583Z","1.0.1":"2016-04-28T19:42:47.606Z","1.0.2":"2017-04-17T08:30:26.350Z","1.0.3":"2017-06-05T21:10:22.412Z","2.0.0":"2021-08-17T02:44:00.950Z","2.0.1":"2021-08-18T13:46:55.927Z","2.1.0":"2021-08-24T04:42:53.494Z","2.1.1":"2024-06-01T00:08:45.744Z"},"maintainers":[{"name":"oztune","email":"oztune+npm@gmail.com"}],"author":{"name":"Oz Michaeli"},"repository":{"type":"git","url":"git+https://github.com/appfigures/string-replace-to-array.git"},"keywords":["string","replace","array","react","emoji"],"license":"MIT","homepage":"https://github.com/appfigures/string-replace-to-array#readme","bugs":{"url":"https://github.com/appfigures/string-replace-to-array/issues"},"readme":"# String replace to array\n\n[![string-replace-to-array MIT license on NPM](https://img.shields.io/npm/l/string-replace-to-array.svg?style=flat-square)](https://www.npmjs.com/package/string-replace-to-array)\n[![string-replace-to-array on NPM](https://img.shields.io/npm/v/string-replace-to-array.svg)](https://www.npmjs.com/package/string-replace-to-array)\n[![Build Status](https://img.shields.io/circleci/project/appfigures/string-replace-to-array.svg)](https://circleci.com/gh/appfigures/string-replace-to-array)\n[![string-replace-to-array total downloads on NPM](https://img.shields.io/npm/dt/string-replace-to-array.svg?style=flat-square)](https://www.npmjs.com/package/string-replace-to-array)\n[![string-replace-to-array monthly downloads on NPM](https://img.shields.io/npm/dm/string-replace-to-array.svg?style=flat-square)](https://www.npmjs.com/package/string-replace-to-array)\n\nWorks just like `String.prototype.replace` but outputs an array instead of a string. It's [tiny](https://bundlephobia.com/package/string-replace-to-array) (<1KB) and has no dependencies.\n\n## Why?\n\nWe built this for use with React, but it's very generic and doesn't depend on any environment. Consider the following scenario.\n\nGiven this string:\n\n```\nvar content = 'Hello\\nworld'\n```\n\nand this React markup:\n\n```\n<span>{ content }</span>\n```\n\nWe'll get this output:\n```\nHello world\n```\n_The newline character is ignored when the browser renders the resulting html._\n\nThe solution is to replace `\\n` with `<br>`:\n\n```\n<span>{ replace(content, '\\n', <br>) }</span>\n```\n\nand the output will be:\n\n```\n<span>Hello</br>world</span>\n```\nWhen rendered:\n```\nHello\nworld\n```\n\nNow the newline will be rendered properly. Yay!\n\n## Example usage\n\n### Simple example\n\n```\nvar replace = require('string-replace-to-array')\nreplace('Hello Amy', 'Amy', { name: 'Amy' })\n// output: ['Hello ', { name: 'Amy' }]\n```\n\n### Full example\n\n```\nreplace(\n  'Hello Hermione Granger...',\n  /(Hermione) (Granger)/g,\n  function (fullName, firstName, lastName, offset, string) {\n    return <Person firstName={ firstName } lastName={ lastName } />\n  }\n)\n\n// output: ['Hello ', <Person firstName=\"Hermione\" lastName=\"Granger\" />, ...]\n```\n\nFor a real-life example check out [react-easy-emoji](https://github.com/appfigures/react-easy-emoji), where this this is used to replace emoji unicode characters with `<img>` tags.\n\n## Installation\n\n```\nnpm install --save string-replace-to-array\n```\n\n## API\n\n```\n(string, regexp|substr, newValue|function) => array\n```\n\nThe API mimics [String.prototype.replace](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace). The only differences are:\n\n- The replacer (third parameter) doesn't have to be a string\n- Returns an array instead of a string\n\n## Inspiration\n\nMainly inspired by this conversation: https://github.com/facebook/react/issues/3386\n\n### Why not use [react-replace-string](https://github.com/iansinnott/react-string-replace)?\n\nBecause we needed the full API of `String.replace`, especially the regex match parameters which get passed to the replace function.\n\n","readmeFilename":"readme.md"}