{"_id":"hyperlinker","_rev":"112440","name":"hyperlinker","description":"Write hyperlinks in the terminal.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"time":{"modified":"2021-06-03T10:44:35.000Z","created":"2017-11-28T03:33:04.128Z","1.0.0":"2017-11-28T03:33:04.128Z"},"users":{},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"repository":{"type":"git","url":"git+https://github.com/jamestalmage/hyperlinker.git"},"versions":{"1.0.0":{"name":"hyperlinker","version":"1.0.0","description":"Write hyperlinks in the terminal.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/hyperlinker.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=4"},"scripts":{"test":"xo && nyc ava"},"files":["index.js","browser.js"],"keywords":["terminal","link","hyperlink","cli"],"browser":"browser.js","dependencies":{},"devDependencies":{"ava":"^0.20.0","chalk":"^2.3.0","codecov":"^2.2.0","nyc":"^11.0.0","xo":"^0.18.2"},"nyc":{"reporter":["lcov","text"]},"gitHead":"10c980aac40191e82e7fd08b8d8022871f9171f2","bugs":{"url":"https://github.com/jamestalmage/hyperlinker/issues"},"homepage":"https://github.com/jamestalmage/hyperlinker#readme","_id":"hyperlinker@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"23dc9e38a206b208ee49bc2d6c8ef47027df0c0e","size":2730,"noattachment":false,"key":"/hyperlinker/-/hyperlinker-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hyperlinker/download/hyperlinker-1.0.0.tgz"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hyperlinker-1.0.0.tgz_1511839983190_0.6319599573034793"},"directories":{},"publish_time":1511839984128,"_hasShrinkwrap":false,"_cnpm_publish_time":1511839984128}},"readme":"# hyperlinker [![Build Status](https://travis-ci.org/jamestalmage/hyperlinker.svg?branch=master)](https://travis-ci.org/jamestalmage/hyperlinker) [![codecov](https://codecov.io/gh/jamestalmage/hyperlinker/badge.svg?branch=master)](https://codecov.io/gh/jamestalmage/hyperlinker?branch=master)\n\n> Write hyperlinks in the terminal.\n\nTerminal emulators are [starting to support hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). While many terminals have long detected URL's and linkified them, allowing you to Command-Click or Control-Click them to open a browser, you were forced to print the long unsightly URL's on the screen. As of spring 2017 [a few terminals](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) began supporting HTML like links, where the link text and destination could be specified separately.\n\nThis module will create hyperlinks when printed to a supported terminal.\n\n## Install\n\n```\n$ npm install hyperlinker\n```\n\n\n## Usage\n\n```js\nconst hyperlinker = require('hyperlinker');\n\nconsole.log(hyperlinker('some text', 'https://example.com') + '   <--- command + click here!');\n// some text    <-- command + click here!\n\n```\n\nNote that this module does not check to see if hyperlinks are supported in the current Terminal. In unsupported terminals, users will likely only see the `text` command. You should use module [`supports-hyperlinks`](https://github.com/jamestalmage/supports-hyperlinks) if you want to provide an alternate presentation based on Terminal support.\n\n```js\nconst supportsHyperlinks = require('supports-hyperlinks');\nconst hyperlinker = require('hyperlinker');\n\nif (supportsHyperlinks.stdout) {\n    console.log(hyperlinker('click here', 'https://example.com'));\n} else {\n    console.log('Copy and paste the following in your browser: \\n\\t https://example.com');\n}\n```\n\n## API\n\n### hyperlinker(text, uri, [params])\n\n#### text\n\nType: `string`\n\nThe text that will be visible in the link. This is equivalent to the text between the opening `<a>` and closing `</a>` tags in HTML.\n\n#### uri\n\nType: `string`\n\nA URI (i.e `https://example.com`) where the link will point to. This is equivalent to the context of the `href` attribute in an HTML `<a>` tag.\n\n#### params\n\nType: `Object`<br>\n*Optional*\n\nA collection of key value pairs, that will be printed as hidden `params`. There's not a lot of use for these right now, except for maybe [an id param](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter). It is intended to allow extension of the spec in the future.\n\n\n## License\n\nMIT © [James Talmage](https://github.com/jamestalmage)\n","_attachments":{},"homepage":"https://github.com/jamestalmage/hyperlinker#readme","bugs":{"url":"https://github.com/jamestalmage/hyperlinker/issues"},"license":"MIT"}