{"_id":"@cjser/micromark-util-chunked","name":"@cjser/micromark-util-chunked","dist-tags":{"latest":"2.0.1-cjser.2"},"versions":{"2.0.1-cjser.2":{"name":"@cjser/micromark-util-chunked","version":"2.0.1-cjser.2","description":"micromark utility to splice and push with giant arrays","license":"MIT","keywords":["micromark","util","utility","chunk","splice","push"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","exports":{"require":"./dist-cjser/index.cjs","development":"./dev/index.js","default":"./index.js"},"dependencies":{"@cjser/micromark-util-symbol":"2.0.1-cjser.2"},"scripts":{"build":"micromark-build"},"xo":{"envs":["shared-node-browser"],"prettier":true,"rules":{"unicorn/prefer-code-point":"off"}},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"2.0.1","cjserVersion":2,"original":{"name":"micromark-util-chunked","version":"2.0.1","exports":{"development":"./dev/index.js","default":"./index.js"},"repository":"https://github.com/micromark/micromark/tree/main/packages/micromark-util-chunked","dependencies":{"micromark-util-symbol":"^2.0.0"},"files":["dev/","index.d.ts.map","index.d.ts","index.js"],"scripts":{"build":"micromark-build"}}},"gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_id":"@cjser/micromark-util-chunked@2.0.1-cjser.2","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-OirXkGnGYBcDBgoYRlyU5KHXUmgZ0puTS0SQoRLNJEPYhJWlwPYLaV7sgMZhOWhajTjEoqGQRl5oEjvdgDBcIg==","shasum":"11eb67708fb07e6f9c8002661fd60f0d75624137","tarball":"https://registry.npmjs.org/@cjser/micromark-util-chunked/-/micromark-util-chunked-2.0.1-cjser.2.tgz","fileCount":10,"unpackedSize":19267,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCBAio7rh6XovUzMyeneZUjn/qyGBjP0yADghISgXdiVQIgK0FCPHfqQhm7TlRD6lQ4rGVEADDTlGDaGYFgOcw11BY="}]},"_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/micromark-util-chunked_2.0.1-cjser.2_1778865004665_0.030658479402847938"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-15T17:10:04.594Z","2.0.1-cjser.2":"2026-05-15T17:10:04.848Z","modified":"2026-05-15T17:10:05.020Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"micromark utility to splice and push with giant arrays","keywords":["micromark","util","utility","chunk","splice","push"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"license":"MIT","readme":"# micromark-util-chunked\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][bundle-size-badge]][bundle-size]\n[![Sponsors][sponsors-badge]][opencollective]\n[![Backers][backers-badge]][opencollective]\n[![Chat][chat-badge]][chat]\n\n[micromark][] utility to splice and push with giant arrays.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`push(list, items)`](#pushlist-items)\n  * [`splice(list, start, remove, items)`](#splicelist-start-remove-items)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package exposes an algorithm to splice for giant arrays, which V8 bugs\nout on.\n\n## When should I use this?\n\nThis package might be useful when you are making your own micromark extensions.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install micromark-util-chunked\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {push, splice} from 'https://esm.sh/micromark-util-chunked@1'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {push, splice} from 'https://esm.sh/micromark-util-chunked@1?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {push, splice} from 'micromark-util-chunked'\n\n// …\n\nnextEvents = push(nextEvents, [\n  ['enter', events[open][1], context],\n  ['exit', events[open][1], context]\n])\n\n// …\n\nsplice(events, open - 1, index - open + 3, nextEvents)\n\n// …\n```\n\n## API\n\nThis module exports the identifiers [`push`][api-push]\nand [`splice`][api-splice].\nThere is no default export.\n\n### `push(list, items)`\n\nAppend `items` (an array) at the end of `list` (another array).\nWhen `list` was empty, returns `items` instead.\n\nThis prevents a potentially expensive operation when `list` is empty,\nand adds items in batches to prevent V8 from hanging.\n\n###### Parameters\n\n* `list` (`Array<unknown>`)\n  — list to operate on\n* `items` (`Array<unknown>`)\n  — items to add to `list`\n\n###### Returns\n\nEither `list` or `items` (`Array<unknown>`).\n\n### `splice(list, start, remove, items)`\n\nLike `Array#splice`, but smarter for giant arrays.\n\n`Array#splice` takes all items to be inserted as individual argument which\ncauses a stack overflow in V8 when trying to insert 100k items for instance.\n\nOtherwise, this does not return the removed items, and takes `items` as an\narray instead of rest parameters.\n\n###### Parameters\n\n* `list` (`Array<unknown>`)\n  — list to operate on\n* `start` (`number`)\n  — index to remove/insert at (can be negative)\n* `remove` (`number`)\n  — number of items to remove\n* `items` (`Array<unknown>`)\n  — items to inject into `list`\n\n###### Returns\n\nNothing (`undefined`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`micromark-util-chunked@2`, compatible with Node.js 16.\nThis package works with `micromark@3`.\n\n## Security\n\nThis package is safe.\nSee [`security.md`][securitymd] in [`micromark/.github`][health] for how to\nsubmit a security report.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`micromark/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organisation, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg\n\n[build]: https://github.com/micromark/micromark/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg\n\n[coverage]: https://codecov.io/github/micromark/micromark\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-chunked.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-util-chunked\n\n[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-chunked\n\n[bundle-size]: https://bundlejs.com/?q=micromark-util-chunked\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[opencollective]: https://opencollective.com/unified\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/micromark/micromark/discussions\n\n[license]: https://github.com/micromark/micromark/blob/main/license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/micromark/.github\n\n[securitymd]: https://github.com/micromark/.github/blob/main/security.md\n\n[contributing]: https://github.com/micromark/.github/blob/main/contributing.md\n\n[support]: https://github.com/micromark/.github/blob/main/support.md\n\n[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md\n\n[typescript]: https://www.typescriptlang.org\n\n[micromark]: https://github.com/micromark/micromark\n\n[api-push]: #pushlist-items\n\n[api-splice]: #splicelist-start-remove-items\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/micromark/micromark/tree/main/packages/micromark-util-chunked\n","readmeFilename":"readme.md","_rev":"1-aaa363b44c081dba4fc6f75764e8d8d1"}