{"name":"marked-terminal","version":"5.2.0","keywords":["marked","render","terminal","markdown","markdown-to-terminal"],"author":{"name":"Mikael Brevik"},"license":"MIT","_id":"marked-terminal@5.2.0","maintainers":[{"name":"mikaelb","email":"mikaelbre@gmail.com"}],"homepage":"https://github.com/mikaelbr/marked-terminal","bugs":{"url":"https://github.com/mikaelbr/marked-terminal/issues"},"dist":{"shasum":"c5370ec2bae24fb2b34e147b731c94fa933559d3","tarball":"http://registry-npm.ywwl.com/marked-terminal/download/marked-terminal-5.2.0.tgz","fileCount":5,"integrity":"sha512-Piv6yNwAQXGFjZSaiNljyNFw7jKDdGrw70FSbtxEyldLsyeuV5ZHm/1wW++kWbrOF1VPnUgYOhB2oLL0ZpnekA==","signatures":[{"sig":"MEYCIQDwtUIYihyfYLAnarDU1tHMrBYRAaxgCWUOTOj72iilggIhAPdZ6DuKrsWFjr8IW1A9rtJ0ZgwuFpB6MNOc6wyy0o0B","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51907,"size":12976,"noattachment":false,"key":"/marked-terminal/-/marked-terminal-5.2.0.tgz"},"main":"./index.cjs","type":"module","browser":"./index.js","engines":{"node":">=14.13.1 || >=16.0.0"},"exports":{"node":{"import":"./index.js","require":"./index.cjs"},"default":"./index.js"},"gitHead":"f35a23a7412c51b24c96363eb4a90514e71c2968","scripts":{"test":"FORCE_HYPERLINK=0 mocha tests/*.js --reporter spec","build":"rollup -c","prepack":"npm run build"},"_npmUser":{"name":"mikaelb","email":"mikaelbre@gmail.com"},"repository":{"url":"git+https://github.com/mikaelbr/marked-terminal.git","type":"git"},"_npmVersion":"9.4.0","description":"A custom render for marked to output to the Terminal","directories":{"example":"example"},"_nodeVersion":"19.6.0","dependencies":{"chalk":"^5.2.0","cardinal":"^2.1.1","cli-table3":"^0.6.3","node-emoji":"^1.11.0","ansi-escapes":"^6.2.0","supports-hyperlinks":"^2.3.0"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.2.0","marked":"^5.0.1","rollup":"^3.21.5","@rollup/plugin-commonjs":"^24.1.0","@rollup/plugin-node-resolve":"^15.0.2"},"peerDependencies":{"marked":"^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/marked-terminal_5.2.0_1683787730530_0.7554513475485294","host":"s3://npm-registry-packages"},"readme":"# marked-terminal\n\n> Custom Renderer for [marked](https://github.com/chjj/marked)\n> allowing for printing Markdown to the Terminal. Supports pretty tables, syntax\n> highlighting for javascript, and overriding all colors and styles.\n\nCould for instance be used to print usage information.\n\n[![build](https://github.com/mikaelbr/marked-terminal/actions/workflows/ci.yml/badge.svg)](https://github.com/mikaelbr/marked-terminal/actions/workflows/ci.yml) [![npm marked-terminal](https://img.shields.io/npm/v/marked-terminal.svg)](https://www.npmjs.com/package/marked-terminal)\n\n## Install\n\n```sh\nnpm install marked marked-terminal\n```\n\n## Example\n\n```javascript\nimport { marked } from 'marked';\nimport { markedTerminal } from 'marked-terminal';\n\nmarked.use(markedTerminal([options][, highlightOptions]));\n\nmarked.parse('# Hello \\n This is **markdown** printed in the `terminal`');\n```\n\n### Using older versions\n\n```javascript\nconst marked = require('marked');\nconst TerminalRenderer = require('marked-terminal');\n\nmarked.setOptions({\n  // Define custom renderer\n  renderer: new TerminalRenderer()\n});\n\n// Show the parsed data\nconsole.log(\n  marked('# Hello \\n This is **markdown** printed in the `terminal`')\n);\n```\n\nThis will produce the following:\n\n![Screenshot of marked-terminal](./screenshot.png)\n\n### Syntax Highlighting\n\nAlso have support for syntax highlighting using [cli-highlight](https://github.com/felixfbecker/cli-highlight).\nYou can override highlighting defaults by passing in settings as the second argument for TerminalRenderer.\n\nHaving the following markdown input:\n\n<pre>\n```js\nvar foo = function(bar) {\n  console.log(bar);\n};\nfoo('Hello');\n```\n</pre>\n\n...we will convert it into terminal format:\n\n```javascript\n// Show the parsed data\nconsole.log(marked(exampleSource));\n```\n\nThis will produce the following:\n\n![Screenshot of marked-terminal](./screenshot2.png)\n\n## API\n\nConstructur: `new TerminalRenderer([options][, highlightOptions])`\n\n### `options`\n\nOptional\nUsed to override default styling.\n\nDefault values are:\n\n```javascript\nvar defaultOptions = {\n  // Colors\n  code: chalk.yellow,\n  blockquote: chalk.gray.italic,\n  html: chalk.gray,\n  heading: chalk.green.bold,\n  firstHeading: chalk.magenta.underline.bold,\n  hr: chalk.reset,\n  listitem: chalk.reset,\n  table: chalk.reset,\n  paragraph: chalk.reset,\n  strong: chalk.bold,\n  em: chalk.italic,\n  codespan: chalk.yellow,\n  del: chalk.dim.gray.strikethrough,\n  link: chalk.blue,\n  href: chalk.blue.underline,\n\n  // Formats the bulletpoints and numbers for lists\n  list: function (body, ordered) {/* ... */},\n\n  // Reflow and print-out width\n  width: 80, // only applicable when reflow is true\n  reflowText: false,\n\n  // Should it prefix headers?\n  showSectionPrefix: true,\n\n  // Whether or not to undo marked escaping\n  // of enitities (\" -> &quot; etc)\n  unescape: true,\n\n  // Whether or not to show emojis\n  emoji: true,\n\n  // Options passed to cli-table3\n  tableOptions: {},\n\n  // The size of tabs in number of spaces or as tab characters\n  tab: 3 // examples: 4, 2, \\t, \\t\\t\n\n  image: function (href, title, text) {} // function for overriding the default image handling.\n};\n```\n\n#### Example of overriding defaults\n\n```javascript\nmarked.setOptions({\n  renderer: new TerminalRenderer({\n    codespan: chalk.underline.magenta\n  })\n});\n```\n\n### `highlightOptions`\n\nOptions passed into [cli-highlight](https://github.com/felixfbecker/cli-highlight). See readme there to see what options to pass.\n\nSee [more examples](./example/)\n\n## Related\n\n- [ink-markdown](https://github.com/cameronhunter/ink-markdown) - Markdown component for Ink\n","publish_time":1683787730718,"_cnpm_publish_time":1683787730718,"dist-tags":{"latest":"8.0.0","release-5.x":"5.2.1","release-6.x":"6.3.1"}}