{"_id":"@tryfabric/mack","name":"@tryfabric/mack","dist-tags":{"latest":"1.2.1"},"versions":{"1.2.1":{"name":"@tryfabric/mack","repository":{"type":"git","url":"git+https://github.com/tryfabric/mack.git"},"version":"1.2.1","description":"Converts Markdown to Slack BlockKit Blocks","main":"build/src/index.js","types":"build/src/index.d.ts","scripts":{"test":"jest","lint":"gts lint","clean":"gts clean","compile":"tsc","fix":"gts fix","prepare":"npm run compile","pretest":"npm run compile","posttest":"npm run lint","release":"release-it"},"keywords":["markdown","parser","gfm","slack"],"author":{"name":"Instantish"},"license":"MIT","dependencies":{"@slack/types":"^2.1.0","fast-xml-parser":"^4.0.6","marked":"^4.0.12"},"devDependencies":{"@types/jest":"^26.0.23","@types/marked":"^4.0.2","@types/node":"^15.12.4","gts":"^3.1.0","jest":"^27.0.5","release-it":"^14.11.6","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"gitHead":"2d8fe99b7b9b0cebfd58f850e264eb9b02f1ffe7","bugs":{"url":"https://github.com/tryfabric/mack/issues"},"homepage":"https://github.com/tryfabric/mack#readme","_id":"@tryfabric/mack@1.2.1","_nodeVersion":"16.14.2","_npmVersion":"8.12.1","dist":{"integrity":"sha512-qQKj3l4x/7fWPHyk3zO3hPK2NUTH8AINJnVbdBYforWpm+6RDzp22gFIE66BJd2z7EFmt7F9aUOyZTKwmxiXrA==","shasum":"21a2916466c93c76ce644cb41401e6bfa4bb5f06","tarball":"https://registry.npmjs.org/@tryfabric/mack/-/mack-1.2.1.tgz","fileCount":35,"unpackedSize":61172,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnqwKfGsRchsttUdSOTxE6/Q3Ba2xWDeyYlM3L6TYA+wIgDtDuhimW9IxzJbrr/C5gCGCg0EOsDa5ruyb2Twx1SFg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimhl+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRpA/9GhJcPnY6zNo7RfjeGipJbnxVHq8c0XPIH6iFhTnfBa8Y7WmV\r\n1PIrhSAHn3cmhtD21Mp0loQRkwz2zSTM2E1OwQvMhWDnUeqUFayHOBmeOlPA\r\n+HQ3k7dwPy7ACfM+ivw+4FJC1n+CEj1Vq8ivrVI4rS1Uf+PF5+xTDPveoJkq\r\nhOe7JTaTFLff1djoswe1BdJKzBjro1qsu6yM/tU6+0MHDGDdo8lax6nnC0Tf\r\nKablB5VEIh9h1X4jLbKSIfeVa6w2e0douKI//PSwiwTJSWjUKE8hW5hs+GIA\r\nwWnI3EA0MpcFJ8a1Bccvdut5r4mZElOnnl0mHZqmFNdH/tk6Y/XzAQ0PAU1v\r\nAkve/cvPo5Yi3Cb03ur5zgPMfjtTygFXcQ90gcr6b6y6Nhb7wxaX6YWFaqTb\r\njpiPlDuaRJ2DEWrmw2ovOhugIeoYcPtDtSODV5TZylASb8Z4jsQ4lKsjC89f\r\nfuQHMYtyvIVHzZqWNRTVonemc9ftcw/3YGlgcNCruB882mkfG+EjM8IQZ6yb\r\naXDCN3HExg8Su5HayQIeBrCCOW/ZLaPS2+RftEaiOA/RIvVkkGoSjMRNXwoR\r\ni6+HSL/DYTe2/fIvFHRFCgGyoX/zA2k2Hn+dYHXdrAeu0tVN/bgVycOiUYId\r\n6ItXwxrEm1DxZbIvn9z78TArEv+T1+DdlwI=\r\n=OLuC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"endbug","email":"fgrandi30@gmail.com"},"directories":{},"maintainers":[{"name":"endbug","email":"fgrandi30@gmail.com"},{"name":"juliarosenson","email":"julia.rosenson@gmail.com"},{"name":"marissamary","email":"marissa@tryfabric.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mack_1.2.1_1654266238790_0.2847546107368657"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-03T14:23:58.737Z","1.2.1":"2022-06-03T14:23:58.952Z","modified":"2022-06-03T14:23:59.097Z"},"maintainers":[{"name":"endbug","email":"fgrandi30@gmail.com"},{"name":"juliarosenson","email":"julia.rosenson@gmail.com"},{"name":"marissamary","email":"marissa@tryfabric.com"}],"description":"Converts Markdown to Slack BlockKit Blocks","homepage":"https://github.com/tryfabric/mack#readme","keywords":["markdown","parser","gfm","slack"],"repository":{"type":"git","url":"git+https://github.com/tryfabric/mack.git"},"author":{"name":"Instantish"},"bugs":{"url":"https://github.com/tryfabric/mack/issues"},"license":"MIT","readme":"# Mack: Markdown to Slack Message Blocks\n\n> Convert Markdown and GitHub Flavoured Markdown to Slack BlockKit Blocks\n\n[![Node.js CI](https://github.com/rr-codes/mack/actions/workflows/ci.yml/badge.svg)](https://github.com/rr-codes/mack/actions/workflows/ci.yml)\n[![Code Style: Google](https://img.shields.io/badge/code%20style-google-blueviolet.svg)](https://github.com/google/gts)\n\nMack is a Markdown parser to convert any Markdown content to Slack BlockKit block objects.\n\nText is truncated to fit within the Slack API's limits.\n\n### Supported Markdown Elements\n\n- All inline elements (italics, bold, strikethrough, inline code, hyperlinks)\n- Lists (ordered, unordered, checkboxes)\n- All headers\n- Code blocks\n- Block quotes (with some limitations)\n- Images\n- Thematic Breaks / Dividers\n- Tables (alignment not preserved)\n\n### Not Yet Supported Markdown Elements\n\n- Block quotes (limited functionality; does not support lists, headings, or images within the block quote)\n\n## Installation\n\n```\nnpm install @tryfabric/mack\n```\n\n## Usage\n\n```ts\nimport {markdownToBlocks} from '@tryfabric/mack';\n\nconst blocks = markdownToBlocks(`\n# Hello world\n\n* bulleted item 1\n* bulleted item 2\n\nabc _123_\n\n![cat](https://images.unsplash.com/photo-1574158622682-e40e69881006)\n`);\n```\n\nThe `blocks` object now results in [this](https://app.slack.com/block-kit-builder/T01BFUV9UPJ#%7B%22blocks%22:%5B%7B%22text%22:%7B%22text%22:%22Hello%20world%22,%22type%22:%22plain_text%22%7D,%22type%22:%22header%22%7D,%7B%22text%22:%7B%22text%22:%22•%20bulleted%20item%201%5Cn•%20bulleted%20item%202%22,%22type%22:%22mrkdwn%22%7D,%22type%22:%22section%22%7D,%7B%22text%22:%7B%22text%22:%22abc%20_123_%22,%22type%22:%22mrkdwn%22%7D,%22type%22:%22section%22%7D,%7B%22alt_text%22:%22cat%22,%22image_url%22:%22https://images.unsplash.com/photo-1574158622682-e40e69881006?w=640%22,%22type%22:%22image%22%7D%5D%7D) payload.\n\n## API\n\n`function markdownToBlocks(text: string, options: ParsingOptions): KnownBlock[]`\n\n- `text`: the content to parse\n- `options`: the options to use when parsing.\n\n### Parsing Options\n\n```ts\ninterface ParsingOptions {\n  // Configure how lists are displayed\n  lists?: ListOptions;\n}\n\ninterface ListOptions {\n  // Configure how checkbox list items are displayed. By default, they are prefixed with '* '\n  checkboxPrefix?: (checked: boolean) => string;\n}\n```\n","readmeFilename":"README.md"}