{"name":"marked-terminal","version":"3.3.0","keywords":["marked","render","terminal","markdown","markdown-to-terminal"],"author":{"name":"Mikael Brevik"},"license":"MIT","_id":"marked-terminal@3.3.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":"25ce0c0299285998c7636beaefc87055341ba1bd","tarball":"http://registry-npm.ywwl.com/marked-terminal/download/marked-terminal-3.3.0.tgz","fileCount":4,"integrity":"sha512-+IUQJ5VlZoAFsM5MHNT7g3RHSkA3eETqhRCdXv4niUMAKHQ7lb1yvAcuGPmm4soxhmtX13u4Li6ZToXtvSEH+A==","signatures":[{"sig":"MEUCIQDlgPklkN0JeW7RcmG0mrSdrZxQofezOHTgU8rkuUt0nQIgLkIAqecxd3K5DAkD7ofd25zj5VHH3eOGFSbh/J5JaHw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdRxgFCRA9TVsSAnZWagAANPQQAJxq/QEJftK7j1ubvvVu\nvsNacj/aQRf29i1f0N0dYvIEsypojRfoJn575DrY5t8xfKb3TjCJFtoT0LSm\nTU4LdAM6Ve4hzeh05/hxInUGSUvxCiYcG0c/J4zsYqAeKEHp7d0ET/g+sk2a\nJgSdA70/9nk16LYLtkbFWHomVLEOkHoUTu0Ff59Y1ZDqgTGecXFBIAYyhYOz\nBowG0J4jxdWzQzIPQx+D/piKEL+cqv7FqcTglIPX4kxnv86o2zl7qNQl3hPH\ndppttnKyHubUW54czsD2WXGxi4vmjUH26eK2D2r/kTcP9aVCml+p2LYXRAN9\nB5TI6qcWUo+CaNSz2+pIe4GHTVUyzcF4cm89DlRYOeuoZdG18IQdg1bVDIpQ\nOUnbdBFsBM2zuNHrMVwwrRw8uRiqgFDbuAolPZ/V64blkNx6tKHsvKckFY33\n5clc0jmS7WYJjb6rqgSg5IzBt+ki4fYxUWwHXL6SP2ClamF1vOA9RScb8SEB\nwRnXRgk6HD9Z5HbtNJjDM9OVc6HdW1vFtVA2zqM0cs53U8rya8c5fgYDQ90e\nor1HOIV95cCi9xU3PIp2rq+8BHV/ntuqF4YF3rcmAKr9CSuYcNRSmRrqu5yv\nCh1Ce26Rrs1XaH5WAQLBr2FzznabRa7e1jzp8WXkYxq4oehfBTzOF5JgIt4K\n8yT/\r\n=wpU+\r\n-----END PGP SIGNATURE-----\r\n","size":6442,"noattachment":false,"key":"/marked-terminal/-/marked-terminal-3.3.0.tgz"},"main":"index.js","gitHead":"f47087216cbdaa8647df60276b80ab3fb7109419","scripts":{"test":"FORCE_HYPERLINK=0 mocha tests/*.js --reporter spec"},"_npmUser":{"name":"mikaelb","email":"mikaelbre@gmail.com"},"repository":{"url":"git+https://github.com/mikaelbr/marked-terminal.git","type":"git"},"_npmVersion":"6.10.0","description":"A custom render for marked to output to the Terminal","directories":{"example":"example"},"_nodeVersion":"12.7.0","dependencies":{"chalk":"^2.4.1","cardinal":"^2.1.1","cli-table":"^0.3.1","node-emoji":"^1.4.1","ansi-escapes":"^3.1.0","supports-hyperlinks":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^5.2.0","marked":"^0.7.0"},"peerDependencies":{"marked":"^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/marked-terminal_3.3.0_1564940292904_0.12741387160667594","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":1564940293015,"_cnpm_publish_time":1564940293015,"dist-tags":{"latest":"8.0.0","release-5.x":"5.2.1","release-6.x":"6.3.1"}}