{"name":"linkify-it","version":"5.0.1","keywords":["linkify","linkifier","autolink","autolinker"],"license":"MIT","_id":"linkify-it@5.0.1","maintainers":[{"name":"vitaly","email":"vitaly@rcopen.com"}],"homepage":"https://github.com/markdown-it/linkify-it#readme","bugs":{"url":"https://github.com/markdown-it/linkify-it/issues"},"dist":{"shasum":"10c4cecbb5c6828eabf81d3c801adc4a542dfb55","tarball":"http://registry-npm.ywwl.com/linkify-it/download/linkify-it-5.0.1.tgz","fileCount":6,"integrity":"sha512-wVoTjP4Q6R0NW5hiZkVJaFZPWgtXfoGF+6LucL3/FtiNjmcHhYjEr5f1Kqjirc1nBW07J/ZuRFumqr2oqccEWg==","signatures":[{"sig":"MEUCIEO5rCbJiWdxFdijJztO7iC6d/NHxIAq0nF4fWgZop4UAiEA0QmzwEiV+JY5U5fMRElhBefoJldnJJt/9qPZUTfz4F0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56003,"size":12708,"noattachment":false,"key":"/linkify-it/-/linkify-it-5.0.1.tgz"},"main":"build/index.cjs.js","module":"index.mjs","exports":{".":{"import":"./index.mjs","require":"./build/index.cjs.js"},"./*":{"import":"./*","require":"./*"}},"funding":[{"url":"https://github.com/sponsors/puzrin","type":"github"},{"url":"https://github.com/sponsors/markdown-it","type":"github"}],"gitHead":"0b72d37950f8eb373f8c233070af4b31ebfec285","scripts":{"doc":"node support/build_doc.mjs","demo":"npm run lint && node support/build_demo.mjs","lint":"eslint .","test":"npm run lint && npm run build && c8 --exclude build --exclude test -r text -r html -r lcov mocha","build":"rollup -c support/rollup.config.mjs","gh-pages":"npm run demo && npm run doc && shx cp -R doc/ demo/ && gh-pages -d demo -f","prepublishOnly":"npm run lint && npm run build && npm run gh-pages"},"_npmUser":{"name":"vitaly","email":"vitaly@rcopen.com"},"repository":{"url":"git+https://github.com/markdown-it/linkify-it.git","type":"git"},"_npmVersion":"10.9.7","description":"Links recognition library with FULL unicode support","directories":{},"_nodeVersion":"22.22.2","dependencies":{"uc.micro":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","shx":"^0.3.2","ansi":"^0.3.0","ndoc":"^6.0.0","tlds":"^1.166.0","mdurl":"^2.0.0","mocha":"^10.2.0","eslint":"^8.54.0","rollup":"^4.6.1","shelljs":"^0.8.4","gh-pages":"^6.1.0","benchmark":"^2.1.0","eslint-config-standard":"^17.1.0","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/linkify-it_5.0.1_1779542266367_0.7519642366704042","host":"s3://npm-registry-packages-npm-production"},"readme":"linkify-it\n==========\n\n[![CI](https://github.com/markdown-it/linkify-it/actions/workflows/ci.yml/badge.svg)](https://github.com/markdown-it/linkify-it/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/linkify-it.svg?style=flat)](https://www.npmjs.org/package/linkify-it)\n[![Coverage Status](https://coveralls.io/repos/github/markdown-it/linkify-it/badge.svg?branch=master)](https://coveralls.io/github/markdown-it/linkify-it?branch=master)\n\n> Links recognition library with FULL unicode support.\n> Focused on high quality link patterns detection in plain text.\n\n__[Demo](http://markdown-it.github.io/linkify-it/)__\n\nWhy it's awesome:\n\n- Full unicode support, _with astral characters_!\n- International domains support.\n- Allows rules extension & custom normalizers.\n\n\nInstall\n-------\n\n```bash\nnpm install linkify-it --save\n```\n\n\nUsage examples\n--------------\n\n```js\nimport { LinkifyIt } from 'linkify-it';\nconst linkify = new LinkifyIt({ fuzzyLink: true });\n\nlinkify\n  .tlds(require('tlds'))\n  .tlds('onion', true)\n  .add('ftp:', null)\n  .set({ fuzzyIP: true });\n\nconsole.log(linkify.test('Site github.com!'));\n// true\n\nconsole.log(linkify.match('Site github.com!'));\n// [ {\n//   schema: \"\",\n//   index: 5,\n//   lastIndex: 15,\n//   raw: \"github.com\",\n//   text: \"github.com\",\n//   url: \"http://github.com\",\n// } ]\n```\n\nSee more in examples folder:\n\n- [twitter mentions](examples/twitter.mjs)\n- [CJK paired brackets in URL paths](examples/cjk-paired-brackets.mjs)\n- [increased nested scopes depth](examples/nested-scopes-depth.mjs)\n\n\nAPI\n---\n\n__[API documentation](http://markdown-it.github.io/linkify-it/doc)__\n\n### new LinkifyIt(options)\n\nCreates new linkifier instance.\n\nBy default understands:\n\n- `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n- \"fuzzy\" emails (foo@bar.com).\n\n`options`:\n\n- __fuzzyLink__ - recognize URL-s without `http(s)://` head. Default `false`.\n- __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts\n  like version numbers. Default `false`.\n- __fuzzyEmail__ - recognize emails without `mailto:` prefix. Default `true`.\n- __tlds__ - allowed TLDs list for fuzzy links. Replaces the default list\n  when set.\n- __---__ - set `true` to terminate link with `---` (if it's considered as long dash).\n  Default `false`.\n- __rebuilder__ - custom `REBuilder` instance for patched regex fragments.\n- __urlAuth__ - recognize authentication data in URLs. Default `false`.\n- __maxLength__ - maximum link length. Default `10000`.\n\n\n### .test(text)\n\nSearches linkifiable pattern and returns `true` on success or `false` on fail.\n\n\n### .testSchemaAt(text, name, offset)\n\nSimilar to `.test()` but checks only specific protocol tail exactly at given\nposition. Returns length of found pattern (0 on fail).\n\n\n### .match(text)\n\nReturns `Array` of found link matches or null if nothing found.\n\nEach match has:\n\n- __schema__ - link schema, can be empty for fuzzy links, or `//` for\n  protocol-neutral  links.\n- __index__ - offset of matched text\n- __lastIndex__ - index of next char after mathch end\n- __raw__ - matched text\n- __text__ - normalized text\n- __url__ - link, generated from matched text\n\n\n### .matchAtStart(text)\n\nChecks if a match exists at the start of the string. Returns `Match`\n(see docs for `match(text)`) or null if no URL is at the start.\nDoesn't work with fuzzy links.\n\n\n### .tlds(list[, keepOld])\n\nLoad (or merge) new tlds list. Those are needed for fuzzy links (without schema)\nto avoid false positives. By default:\n\n- 2-letter root zones are ok.\n- biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф are ok.\n- encoded (`xn--...`) root zones are ok.\n\nIf that's not enough, you can reload defaults with more detailed zones list.\n\n### .add(key, value)\n\nAdd a new schema to the schemas object.\n\n`key` is a link prefix (usually, protocol name with `:` at the end, `skype:`\nfor example). `linkify-it` makes sure that prefix is not preceded with\nalphanumeric char.\n\n`value` is a rule to check tail after link prefix:\n\n- _Object_\n  - _validate_ - validator function which, given arguments _text_, _pos_, and\n    _self_, returns the length of a match in _text_ starting at index _pos_.\n    _pos_ is the index right after the link prefix. _self_ can be used to\n    access the linkify object to cache data.\n  - _normalize_ - optional function to normalize text & url of matched result\n    (for example, for twitter mentions).\n\nTo disable an existing rule, use `.add(key, null)`.\n\n\n### .set(options)\n\nOverride default options. Missed properties will not be changed.\n","publish_time":1779542266516,"_cnpm_publish_time":1779542266516,"dist-tags":{"latest":"6.1.0"}}