{"_id":"@react-code-view/core","_rev":"3-9854a22220f0ea9831447a3eefabd054","name":"@react-code-view/core","dist-tags":{"latest":"3.1.0"},"versions":{"3.0.0":{"name":"@react-code-view/core","version":"3.0.0","keywords":["markdown","transform","highlight","code"],"license":"MIT","_id":"@react-code-view/core@3.0.0","maintainers":[{"name":"simonguo","email":"simonguo.2009@gmail.com"}],"homepage":"https://github.com/simonguo/react-code-view#readme","bugs":{"url":"https://github.com/simonguo/react-code-view/issues"},"dist":{"shasum":"f84c83ecaae1397185c48238a553d600157ef379","tarball":"https://registry.npmjs.org/@react-code-view/core/-/core-3.0.0.tgz","fileCount":9,"integrity":"sha512-7IRUn2mq8/nBggt5G+0nkIBpqMy7wXTcdzcbBAGwECJ8HrQ8xuz64vvc/Redg9QkqqREnN7RJ9e5xSEq+Plb/w==","signatures":[{"sig":"MEQCID++V75hBd6VfdqpCHZ7xJAXDljVwTZFFn1B6hHdYLz4AiAHVWQ0Gihsts7pyn46cY9zlPkfBgqdYVYN0vaZAD8Tgw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@react-code-view%2fcore@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":35211},"main":"./dist/index.cjs","type":"module","_from":"file:react-code-view-core-3.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"simonguo","email":"simonguo.2009@gmail.com"},"_resolved":"/tmp/887e977bfa2b4cc6962acf77b63f078e/react-code-view-core-3.0.0.tgz","_integrity":"sha512-7IRUn2mq8/nBggt5G+0nkIBpqMy7wXTcdzcbBAGwECJ8HrQ8xuz64vvc/Redg9QkqqREnN7RJ9e5xSEq+Plb/w==","repository":{"url":"git+https://github.com/simonguo/react-code-view.git","type":"git","directory":"packages/core"},"_npmVersion":"10.8.2","description":"Core markdown transformation utilities for react-code-view","directories":{},"sideEffects":false,"_nodeVersion":"18.20.8","dependencies":{"shiki":"^1.22.2","marked":"^12.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","rimraf":"^5.0.0","vitest":"^1.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/core_3.0.0_1766990976845_0.7313664975469791","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"@react-code-view/core","version":"3.0.1","keywords":["markdown","transform","highlight","code"],"license":"MIT","_id":"@react-code-view/core@3.0.1","maintainers":[{"name":"simonguo","email":"simonguo.2009@gmail.com"}],"homepage":"https://github.com/simonguo/react-code-view#readme","bugs":{"url":"https://github.com/simonguo/react-code-view/issues"},"dist":{"shasum":"011a42f064d4dd2f220bd20280cfb7cede7749c8","tarball":"https://registry.npmjs.org/@react-code-view/core/-/core-3.0.1.tgz","fileCount":9,"integrity":"sha512-9KTRvhV+X84dgHfmlo2BvtOksoxL+6trkxVSmmKRieBypRYtNEluh0q+dpwVEo0wob8heLfVHZqNumbDsW9mWQ==","signatures":[{"sig":"MEQCHxY5fYWc36ZSIdHEMY/KZEi8OKxBXMpLuX0xC7ZTBAQCIQDzg2iW2yophl6AzqRD/L4yAnfVxuzfw2DjosFrPB8o3A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@react-code-view%2fcore@3.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":35928},"main":"./dist/index.cjs","type":"module","_from":"file:react-code-view-core-3.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"simonguo","email":"simonguo.2009@gmail.com"},"_resolved":"/tmp/88076dae75ff5007ef03fca931b3cc9a/react-code-view-core-3.0.1.tgz","_integrity":"sha512-9KTRvhV+X84dgHfmlo2BvtOksoxL+6trkxVSmmKRieBypRYtNEluh0q+dpwVEo0wob8heLfVHZqNumbDsW9mWQ==","repository":{"url":"git+https://github.com/simonguo/react-code-view.git","type":"git","directory":"packages/core"},"_npmVersion":"10.8.2","description":"Core markdown transformation utilities for react-code-view","directories":{},"sideEffects":false,"_nodeVersion":"18.20.8","dependencies":{"shiki":"^1.22.2","marked":"^12.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","rimraf":"^5.0.0","vitest":"^1.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/core_3.0.1_1767064296105_0.010680344140887144","host":"s3://npm-registry-packages-npm-production"}},"3.1.0":{"name":"@react-code-view/core","version":"3.1.0","description":"Core markdown transformation utilities for react-code-view","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"sideEffects":false,"dependencies":{"shiki":"^1.22.2","marked":"^12.0.0"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0","vitest":"^1.0.0","rimraf":"^5.0.0"},"keywords":["markdown","transform","highlight","code"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/simonguo/react-code-view.git","directory":"packages/core"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","clean":"rimraf dist"},"_id":"@react-code-view/core@3.1.0","bugs":{"url":"https://github.com/simonguo/react-code-view/issues"},"homepage":"https://github.com/simonguo/react-code-view#readme","_integrity":"sha512-DI60MmKTvImySaZQWnnJydJOZCLXXkdb5zze/Mey8D4FlWrzyGkaHxN82M+3JrBfBckYM6a+ONft82jHURhQ0Q==","_resolved":"/tmp/b81f99640ead4b4f4ee8573c2ccec7dc/react-code-view-core-3.1.0.tgz","_from":"file:react-code-view-core-3.1.0.tgz","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-DI60MmKTvImySaZQWnnJydJOZCLXXkdb5zze/Mey8D4FlWrzyGkaHxN82M+3JrBfBckYM6a+ONft82jHURhQ0Q==","shasum":"9620178d3eb0e642408c0a7931996af1bac5c785","tarball":"https://registry.npmjs.org/@react-code-view/core/-/core-3.1.0.tgz","fileCount":9,"unpackedSize":36165,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@react-code-view%2fcore@3.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEQEvE+afrocCUBFCXG197WxTJodWB2WcOpM5+qfOXyOAiBLgtW10xOyOtALhbB0moM4Hynu8zkWlswuNLV5mxLWhw=="}]},"_npmUser":{"name":"simonguo","email":"simonguo.2009@gmail.com"},"directories":{},"maintainers":[{"name":"simonguo","email":"simonguo.2009@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_3.1.0_1767501689009_0.0634350452644874"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-29T06:49:36.769Z","modified":"2026-01-04T04:41:29.531Z","3.0.0":"2025-12-29T06:49:36.989Z","3.0.1":"2025-12-30T03:11:36.238Z","3.1.0":"2026-01-04T04:41:29.148Z"},"bugs":{"url":"https://github.com/simonguo/react-code-view/issues"},"license":"MIT","homepage":"https://github.com/simonguo/react-code-view#readme","keywords":["markdown","transform","highlight","code"],"repository":{"type":"git","url":"git+https://github.com/simonguo/react-code-view.git","directory":"packages/core"},"description":"Core markdown transformation utilities for react-code-view","maintainers":[{"name":"simonguo","email":"simonguo.2009@gmail.com"}],"readme":"# @react-code-view/core\n\nCore markdown transformation utilities for react-code-view. This package is framework-agnostic and can be used in any JavaScript environment.\n\n## Installation\n\n```bash\nnpm install @react-code-view/core\n```\n\n## Usage\n\n### Basic Transformation\n\n```js\nimport { transformMarkdown } from '@react-code-view/core';\n\nconst markdown = `\n# Hello World\n\n\\`\\`\\`javascript\nconst greeting = 'Hello!';\nconsole.log(greeting);\n\\`\\`\\`\n`;\n\nconst result = await transformMarkdown(markdown);\nconsole.log(result.code); // ES module string\n```\n\n### Custom Languages\n\n```js\nimport { transformMarkdown } from '@react-code-view/core';\n\nconst result = await transformMarkdown(markdown, {\n  languages: ['typescript', 'rust', 'python']\n});\n```\n\n### Direct Highlighting\n\n```js\nimport { highlight, initHighlighter } from '@react-code-view/core';\n\n// Initialize highlighter (optional, will auto-initialize on first use)\nawait initHighlighter();\n\nconst highlighted = await highlight('print(\"Hello\")', { language: 'python' });\n```\n\n## API\n\n### `transformMarkdown(source, options?)`\n\nTransform markdown to an ES module string.\n\n**Options:**\n- `languages` - Languages to register for highlighting\n- `markedOptions` - Options passed to marked\n- `codeBlockClassName` - Custom class for code blocks\n\n### `highlight(code, options?)`\n\nHighlight code with syntax highlighting using Shiki.\n\n**Options:**\n- `language` - Programming language (e.g., 'javascript', 'python')\n- `theme` - Shiki theme (default: 'github-light')\n\n### `initHighlighter()`\n\nInitialize the Shiki highlighter. Called automatically on first use.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}