{"_id":"mdast-util-slice-markdown","_rev":"5-c806c05312720a5a5e3328a2a7858a16","name":"mdast-util-slice-markdown","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"mdast-util-slice-markdown","version":"1.0.0","keywords":["mdast","markdown","slice","ast","unist","performance"],"author":{"name":"avivkeller"},"license":"MIT","_id":"mdast-util-slice-markdown@1.0.0","maintainers":[{"name":"redyetidev","email":"redyetidev@gmail.com"}],"dist":{"shasum":"22c025078ea3474707eab884985ee73034bb821b","tarball":"https://registry.npmjs.org/mdast-util-slice-markdown/-/mdast-util-slice-markdown-1.0.0.tgz","fileCount":4,"integrity":"sha512-LN7RskGYqqNWEPVz40do00Xr82+LMkR1nnoQCk2e9vRz6xw8tgP6ENTWV2bJhJ/ITqoCUU7K64UU/KbXkozmyg==","signatures":[{"sig":"MEQCIBnNwlWnC3YkIMyGYmUGJKxZXvap1LioR6Qu+5sXGUVrAiBo7Kz8ff1E6qZKnNZW71N/32hPUbUQikr5+w3RqWBZyg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22345},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"32b5eca16876b9ec331c44bc188f587fa1e26900","scripts":{"dev":"tsc --watch","lint":"eslint {src,test}/**/*.{js,ts} --fix","test":"node --experimental-strip-types --test test/index.test.mjs","build":"tsc","format":"prettier --write \"{src,test}/**/*.{js,ts,json,md}\"","typecheck":"tsc --noEmit","lint:check":"eslint {src,test}/**/*.{js,ts}","format:check":"prettier --check \"{src,test}/**/*.{js,ts,json,md}\"","test:coverage":"c8 npm run test","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"redyetidev","email":"redyetidev@gmail.com"},"_npmVersion":"11.3.0","description":"Highly optimized MDAST tree slicing with configurable node behaviors","directories":{},"_nodeVersion":"24.0.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","eslint":"^9.28.0","globals":"^16.2.0","prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^22.15.30","@types/mdast":"^4.0.4","@types/unist":"^3.0.3","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.4.1","mdast-util-to-markdown":"^2.1.2","mdast-util-from-markdown":"^2.0.2","@typescript-eslint/parser":"^8.33.1","@typescript-eslint/eslint-plugin":"^8.33.1"},"_npmOperationalInternal":{"tmp":"tmp/mdast-util-slice-markdown_1.0.0_1749325884787_0.8520602491483131","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"mdast-util-slice-markdown","version":"1.1.0","keywords":["mdast","markdown","slice","ast","unist","performance"],"author":{"name":"avivkeller"},"license":"MIT","_id":"mdast-util-slice-markdown@1.1.0","maintainers":[{"name":"redyetidev","email":"redyetidev@gmail.com"}],"dist":{"shasum":"638e15e8c6c921b963b4707bdfb68f3bb81660fc","tarball":"https://registry.npmjs.org/mdast-util-slice-markdown/-/mdast-util-slice-markdown-1.1.0.tgz","fileCount":4,"integrity":"sha512-sudf3ZHRcXpILNaHrAeWgpd40OPqvbmF2x2kxPbOuSOGlZBQwa1is8ZylP5QbZpND51HysI/oI/hbpgRrRHzAg==","signatures":[{"sig":"MEYCIQCnyGkqUTfkya5gYyXo3ZqebpAmf+nhP9AaTmSf4/ggPgIhAJVS8I/c55wd0EgaVPlYS8foM8auBlbbUiK4ICxnRMlv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22747},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"fd2f24a2814f19d47b44f334c47fcfc42eb0b115","scripts":{"dev":"tsc --watch","lint":"eslint {src,test}/**/*.{js,ts} --fix","test":"node --experimental-strip-types --test test/index.test.mjs","build":"tsc","format":"prettier --write \"{src,test}/**/*.{js,ts,json,md}\"","typecheck":"tsc --noEmit","lint:check":"eslint {src,test}/**/*.{js,ts}","format:check":"prettier --check \"{src,test}/**/*.{js,ts,json,md}\"","test:coverage":"c8 npm run test","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"redyetidev","email":"redyetidev@gmail.com"},"_npmVersion":"11.3.0","description":"Highly optimized MDAST tree slicing with configurable node behaviors","directories":{},"_nodeVersion":"24.0.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","eslint":"^9.28.0","globals":"^16.2.0","prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^22.15.30","@types/mdast":"^4.0.4","@types/unist":"^3.0.3","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.4.1","mdast-util-to-markdown":"^2.1.2","mdast-util-from-markdown":"^2.0.2","@typescript-eslint/parser":"^8.33.1","@typescript-eslint/eslint-plugin":"^8.33.1"},"_npmOperationalInternal":{"tmp":"tmp/mdast-util-slice-markdown_1.1.0_1749330052973_0.8945551111244159","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"mdast-util-slice-markdown","version":"2.0.0","keywords":["mdast","markdown","slice","ast","unist","performance"],"author":{"name":"avivkeller"},"license":"MIT","_id":"mdast-util-slice-markdown@2.0.0","maintainers":[{"name":"redyetidev","email":"redyetidev@gmail.com"}],"dist":{"shasum":"945112e539b2467a82eaab95d2f49bf716171387","tarball":"https://registry.npmjs.org/mdast-util-slice-markdown/-/mdast-util-slice-markdown-2.0.0.tgz","fileCount":5,"integrity":"sha512-MyiOn83Y5uLWgrOhPOkoMamYJVC2fU6uxcErg8yWWlgj8G+K/HfjErWJ5DrZImQqxe11VAWPHMHvXtCR6as/4g==","signatures":[{"sig":"MEUCIHvHK3GC15RQO+4CtUdc8rOONFsW9Vy6unwKJFbikol5AiEAmWEyh/x6cDptkK3nDlY1UWr5Rz/7bbSeqYP44ddVaak=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49402},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"6507a4da3d122f10f1d03003b3ae9bc212fce5e1","scripts":{"dev":"tsc --watch","lint":"eslint . --fix","test":"node --experimental-strip-types --test test/index.test.ts","build":"tsc","format":"prettier --write .","typecheck":"tsc --noEmit","lint:check":"eslint .","format:check":"prettier --check .","test:coverage":"c8 npm run test","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"redyetidev","email":"redyetidev@gmail.com"},"_npmVersion":"10.9.2","description":"Highly optimized MDAST tree slicing with configurable node behaviors","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","eslint":"^9.28.0","globals":"^16.2.0","prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^22.15.30","@types/mdast":"^4.0.4","@types/unist":"^3.0.3","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.4.1","mdast-util-to-markdown":"^2.1.2","mdast-util-from-markdown":"^2.0.2","@typescript-eslint/parser":"^8.33.1","@typescript-eslint/eslint-plugin":"^8.33.1"},"_npmOperationalInternal":{"tmp":"tmp/mdast-util-slice-markdown_2.0.0_1752436490336_0.27679355854131815","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"mdast-util-slice-markdown","version":"2.0.1","keywords":["mdast","markdown","slice","ast","unist","performance"],"author":{"name":"avivkeller"},"license":"MIT","_id":"mdast-util-slice-markdown@2.0.1","maintainers":[{"name":"redyetidev","email":"redyetidev@gmail.com"}],"dist":{"shasum":"987c98f176a556651617125c5939ff88b796b51e","tarball":"https://registry.npmjs.org/mdast-util-slice-markdown/-/mdast-util-slice-markdown-2.0.1.tgz","fileCount":5,"integrity":"sha512-79sT5nWLuY9AUy6vpf3dgfblq6d+UiVm7HjraFNnx5/oc6ct/8/0xTZ+QxaYvEHNikvaI+F1pxwfQxiFwVrBCA==","signatures":[{"sig":"MEUCIQCzaWuLpYeIzlKHFukB/iiC+xp0h6JKCtl8QjV+Q2+iJwIgW2Iec3tx7tmmst94HmGKs+J6zXhUgqCxPPuz27pWdnI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49402},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8289fa28e9bb792da2cdcce95216b71d009b9251","scripts":{"dev":"tsc --watch","lint":"eslint . --fix","test":"node --experimental-strip-types --test test/index.test.ts","build":"tsc","format":"prettier --write .","typecheck":"tsc --noEmit","lint:check":"eslint .","format:check":"prettier --check .","test:coverage":"c8 npm run test","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"redyetidev","email":"redyetidev@gmail.com"},"_npmVersion":"10.9.2","description":"Highly optimized MDAST tree slicing with configurable node behaviors","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","eslint":"^9.28.0","globals":"^16.2.0","prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^22.15.30","@types/mdast":"^4.0.4","@types/unist":"^3.0.3","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.4.1","mdast-util-to-markdown":"^2.1.2","mdast-util-from-markdown":"^2.0.2","@typescript-eslint/parser":"^8.33.1","@typescript-eslint/eslint-plugin":"^8.33.1"},"_npmOperationalInternal":{"tmp":"tmp/mdast-util-slice-markdown_2.0.1_1752523337996_0.3553672884540986","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-06-07T19:51:24.786Z","modified":"2026-01-12T20:29:12.770Z","1.0.0":"2025-06-07T19:51:24.985Z","1.1.0":"2025-06-07T21:00:53.197Z","2.0.0":"2025-07-13T19:54:50.513Z","2.0.1":"2025-07-14T20:02:18.203Z"},"author":{"name":"avivkeller"},"license":"MIT","keywords":["mdast","markdown","slice","ast","unist","performance"],"description":"Highly optimized MDAST tree slicing with configurable node behaviors","maintainers":[{"email":"me@aviv.sh","name":"avivkeller"}],"readme":"# `mdast-util-slice-markdown`\n\nA powerful, highly configurable TypeScript library for slicing markdown Abstract Syntax Trees (AST) by character position.\n\n## Installation\n\n```bash\nnpm install mdast-util-slice-markdown\n```\n\n## Quick Start\n\n```typescript\nimport { slice } from 'mdast-util-slice-markdown'\n\n// Basic text slicing\nconst textNode = { type: 'text', value: 'Hello world!' }\nconst result = slice(textNode, 2, 8)\nconsole.log(result.node.value) // \"llo wo\"\n\n// Slice with formatting preservation\nconst paragraph = {\n  type: 'paragraph',\n  children: [\n    { type: 'text', value: 'Start ' },\n    { type: 'emphasis', children: [{ type: 'text', value: 'italic' }] },\n    { type: 'text', value: ' end' },\n  ],\n}\n\nconst sliced = slice(paragraph, 6, 12)\n// Preserves emphasis formatting within the slice\n```\n\n## Core API\n\n### `slice(tree, start, end?, config?)`\n\nSlice a markdown AST from start to end position.\n\n```typescript\nfunction slice(tree: Node, start: number, end?: number, config?: SliceConfig): SliceResult\n```\n\n**Parameters:**\n\n- `tree`: The markdown AST node to slice\n- `start`: Starting character position (inclusive)\n- `end`: Ending character position (exclusive). If omitted, slices to end\n- `config`: Optional configuration object\n\n**Returns:** A `SliceResult` object with:\n\n- `node`: The sliced AST node (or null)\n- `boundaries`: Actual slice boundaries\n- `info`: Detailed information about the operation\n\n### `length(tree)`\n\nCalculate the total character length of a markdown tree.\n\n```typescript\nfunction length(tree: Node): number\n```\n\n### `findText(tree, searchText)`\n\nFind all character positions where text occurs in the tree.\n\n```typescript\nfunction findText(tree: Node, searchText: string): number[]\n```\n\n## Configuration Options\n\n### Partial Node Handling\n\nControl how nodes that cross slice boundaries are handled:\n\n```typescript\nconst config = {\n  partialNodes: {\n    text: 'truncate', // 'truncate' | 'include-full' | 'exclude-full'\n    code: 'include-full', // 'truncate' | 'include-full' | 'exclude-full'\n    inlineCode: 'truncate', // 'truncate' | 'include-full' | 'exclude-full'\n    formatting: 'preserve', // 'strip' | 'preserve' | 'extend'\n    media: 'preserve', // 'strip' | 'preserve' | 'content-only'\n    blocks: 'include', // 'include' | 'exclude' | 'unwrap'\n  },\n}\n```\n\n**Text/Code Options:**\n\n- `truncate`: Cut the text at slice boundaries\n- `include-full`: Include the entire node even if partially outside\n- `exclude-full`: Exclude the entire node if partially outside\n\n**Formatting Options:**\n\n- `strip`: Remove formatting, keep content\n- `preserve`: Keep formatting as-is\n- `extend`: Extend formatting to cover slice boundaries\n\n**Media Options:**\n\n- `strip`: Remove links/images entirely\n- `preserve`: Keep links/images intact\n- `content-only`: Extract link text without the link\n\n**Block Options:**\n\n- `include`: Include the block container\n- `exclude`: Exclude blocks that cross boundaries\n- `unwrap`: Remove block wrapper, keep content\n\n### Text Handling\n\nFine-tune text processing:\n\n```typescript\nconst config = {\n  textHandling: {\n    boundaries: 'trim', // 'trim' | 'preserve' | 'normalize'\n    mergeAdjacent: true, // Merge adjacent text nodes\n    preserveLineBreaks: true, // Keep line breaks in text\n  },\n}\n```\n\n### Content Filtering\n\nControl what content to include:\n\n```typescript\nconst config = {\n  content: {\n    includeHidden: false, // Include HTML comments, etc.\n    includeReferences: false, // Include reference definitions\n    includeFootnotes: false, // Include footnote definitions\n  },\n}\n```\n\n## Preset Configurations\n\n### Text-Only Extraction\n\nExtract clean text without any formatting:\n\n```typescript\nimport { presets } from 'mdast-util-slice-markdown'\n\nconst result = slice(tree, 10, 50, presets.textOnly)\n```\n\n### Structured Slicing\n\nPreserve structure while handling partials gracefully:\n\n```typescript\nconst result = slice(tree, 10, 50, presets.structured)\n```\n\n### Inclusive Slicing\n\nInclude full nodes even if partially outside slice:\n\n```typescript\nconst result = slice(tree, 10, 50, presets.inclusive)\n```\n\n### Conservative Slicing\n\nExclude partials when in doubt:\n\n```typescript\nconst result = slice(tree, 10, 50, presets.conservative)\n```\n\n## Examples\n\n### Basic Text Slicing\n\n```typescript\nconst textNode = { type: 'text', value: 'Hello, world!' }\nconst result = slice(textNode, 7, 12)\nconsole.log(result.node.value) // \"world\"\n```\n\n### Slicing with Formatting\n\n```typescript\nconst paragraph = {\n  type: 'paragraph',\n  children: [\n    { type: 'text', value: 'This is ' },\n    { type: 'emphasis', children: [{ type: 'text', value: 'emphasized' }] },\n    { type: 'text', value: ' text.' },\n  ],\n}\n\n// Preserve emphasis formatting\nconst result = slice(paragraph, 5, 15, {\n  partialNodes: { formatting: 'preserve' },\n})\n\n// Strip formatting, keep content only\nconst textOnly = slice(paragraph, 5, 15, {\n  partialNodes: { formatting: 'strip' },\n})\n```\n\n### Code Block Handling\n\n```typescript\nconst codeBlock = {\n  type: 'code',\n  value: 'function hello() {\\n  console.log(\"world\");\\n}',\n  lang: 'javascript',\n}\n\n// Include full code block even if partially sliced\nconst result = slice(codeBlock, 10, 20, {\n  partialNodes: { code: 'include-full' },\n})\n\n// Truncate code at slice boundaries\nconst truncated = slice(codeBlock, 10, 20, {\n  partialNodes: { code: 'truncate' },\n})\n```\n\n### Link Handling\n\n```typescript\nconst linkNode = {\n  type: 'link',\n  url: 'https://example.com',\n  children: [{ type: 'text', value: 'Click here' }],\n}\n\n// Preserve link structure\nconst withLink = slice(linkNode, 2, 8, {\n  partialNodes: { media: 'preserve' },\n})\n\n// Extract link text only\nconst textOnly = slice(linkNode, 2, 8, {\n  partialNodes: { media: 'content-only' },\n})\n```\n\n### Complex Document Slicing\n\n```typescript\nconst document = {\n  type: 'root',\n  children: [\n    {\n      type: 'heading',\n      depth: 1,\n      children: [{ type: 'text', value: 'Introduction' }],\n    },\n    {\n      type: 'paragraph',\n      children: [\n        { type: 'text', value: 'This document explains ' },\n        { type: 'emphasis', children: [{ type: 'text', value: 'markdown slicing' }] },\n        { type: 'text', value: ' techniques.' },\n      ],\n    },\n  ],\n}\n\n// Slice across multiple elements\nconst result = slice(document, 10, 40, {\n  partialNodes: {\n    blocks: 'include',\n    formatting: 'preserve',\n  },\n})\n```\n\n### Finding Text Positions\n\n```typescript\nconst document = {\n  type: 'paragraph',\n  children: [{ type: 'text', value: 'Search for this word and this word too' }],\n}\n\nconst positions = findText(document, 'this')\nconsole.log(positions) // [11, 30]\n\n// Use positions for targeted slicing\nconst firstMatch = slice(document, positions[0], positions[0] + 4)\n```\n\n## Result Information\n\nThe `SliceResult` object provides detailed information about the operation:\n\n```typescript\nconst result = slice(tree, 10, 50)\n\nconsole.log(result.boundaries) // { start: 10, end: 50 }\nconsole.log(result.info.originalLength) // Total characters in original\nconsole.log(result.info.slicedLength) // Characters in result\nconsole.log(result.info.hasPartialNodes) // Were any nodes partially sliced?\nconsole.log(result.info.modifiedNodeTypes) // Which node types were modified?\n```\n\n## Working with Different Node Types\n\n### Text Nodes\n\n```typescript\nconst textNode = { type: 'text', value: 'Hello world' }\n\n// Basic slicing\nslice(textNode, 2, 8) // \"llo wo\"\n\n// Whitespace handling\nslice(textNode, 2, 8, {\n  textHandling: { boundaries: 'trim' },\n})\n```\n\n### Code Nodes\n\n```typescript\nconst codeNode = {\n  type: 'code',\n  value: 'const x = 1;\\nconst y = 2;',\n  lang: 'javascript',\n}\n\n// Preserve language information\nconst result = slice(codeNode, 5, 15)\nconsole.log(result.node.lang) // 'javascript'\n```\n\n### Formatting Nodes\n\n```typescript\nconst emphasized = {\n  type: 'emphasis',\n  children: [{ type: 'text', value: 'italic text' }],\n}\n\n// Different formatting strategies\nslice(emphasized, 2, 8, { partialNodes: { formatting: 'preserve' } })\nslice(emphasized, 2, 8, { partialNodes: { formatting: 'strip' } })\nslice(emphasized, 2, 8, { partialNodes: { formatting: 'extend' } })\n```\n\n### Lists\n\n```typescript\nconst list = {\n  type: 'list',\n  ordered: false,\n  children: [\n    {\n      type: 'listItem',\n      children: [\n        {\n          type: 'paragraph',\n          children: [{ type: 'text', value: 'First item' }],\n        },\n      ],\n    },\n    {\n      type: 'listItem',\n      children: [\n        {\n          type: 'paragraph',\n          children: [{ type: 'text', value: 'Second item' }],\n        },\n      ],\n    },\n  ],\n}\n\n// Slice through list items\nconst result = slice(list, 5, 15, {\n  partialNodes: { blocks: 'include' },\n})\n```\n\n## Performance Considerations\n\n### Caching\n\nLength calculations are automatically cached for performance:\n\n```typescript\nconst tree = /* large markdown tree */;\n\n// First call calculates and caches lengths\nconst length1 = length(tree);\n\n// Subsequent calls use cached values\nconst length2 = length(tree); // Much faster\n```\n\n### Memory Usage\n\nFor large documents, consider slicing in chunks:\n\n```typescript\nconst largeDocument = /* very large markdown tree */;\nconst chunkSize = 1000;\nconst totalLength = length(largeDocument);\n\nfor (let i = 0; i < totalLength; i += chunkSize) {\n  const chunk = slice(largeDocument, i, i + chunkSize);\n  // Process chunk\n}\n```\n\n## Advanced Usage\n\n### Custom Configuration Combinations\n\n```typescript\nconst customConfig = {\n  partialNodes: {\n    text: 'truncate',\n    code: 'include-full',\n    formatting: 'preserve',\n    media: 'content-only',\n    blocks: 'unwrap',\n  },\n  textHandling: {\n    boundaries: 'trim',\n    mergeAdjacent: true,\n  },\n  content: {\n    includeHidden: false,\n    includeReferences: false,\n  },\n}\n\nconst result = slice(tree, 10, 50, customConfig)\n```\n\n### Building Custom Presets\n\n```typescript\nconst myPreset = {\n  partialNodes: {\n    formatting: 'strip',\n    media: 'content-only',\n    blocks: 'unwrap',\n  },\n  textHandling: {\n    boundaries: 'normalize',\n    mergeAdjacent: true,\n  },\n}\n\n// Use across multiple slicing operations\nconst result1 = slice(tree1, 0, 50, myPreset)\nconst result2 = slice(tree2, 10, 60, myPreset)\n```\n\n## Error Handling\n\nThe library handles various edge cases gracefully:\n\n```typescript\n// Invalid inputs\nslice(null, 0, 10) // Returns null result\nslice(tree, -1, 10) // Returns null result\nslice(tree, 10, 5) // Returns null result (start >= end)\n\n// Boundary conditions\nslice(tree, 0, 0) // Returns null (empty slice)\nslice(tree, 1000, 2000) // Returns null if start > tree length\n\n// Malformed nodes are handled safely\nconst malformedNode = { type: 'text' } // Missing value\nslice(malformedNode, 0, 5) // Handles gracefully\n```\n\n## TypeScript Support\n\nFull TypeScript support with proper type definitions:\n\n```typescript\nimport { slice, SliceConfig, SliceResult } from 'mdast-util-slice-markdown'\nimport { Node } from 'unist'\n\nconst config: SliceConfig = {\n  partialNodes: {\n    text: 'truncate',\n  },\n}\n\nconst result: SliceResult = slice(tree, 10, 50, config)\n```\n\n## License\n\nMIT License - see LICENSE file for details.\n","readmeFilename":"README.md"}