{"name":"linkify-it","version":"6.1.0","description":"Links recognition library with FULL unicode support","keywords":["linkify","linkifier","autolink","autolinker"],"repository":{"type":"git","url":"git+https://github.com/markdown-it/linkify-it.git"},"main":"build/index.cjs.js","module":"build/index.mjs","types":"build/index.d.ts","exports":{".":{"types":"./build/index.d.ts","require":"./build/index.cjs.js","import":"./build/index.mjs"},"./package.json":"./package.json"},"license":"MIT","funding":[{"type":"github","url":"https://github.com/sponsors/puzrin"},{"type":"github","url":"https://github.com/sponsors/markdown-it"}],"scripts":{"lint":"eslint .","type-check":"tsc --noEmit","test":"npm run lint && npm run build && npm run type-check && c8 --exclude build --exclude test -r text -r html -r lcov node --test","doc":"typedoc","build":"node support/build_dist.mjs && node support/build_demo.mjs","gh-pages":"npm run build && npm run doc && gh-pages -d demo -f","prepack":"npm test && npm run doc","postpublish":"npm run gh-pages"},"dependencies":{"uc.micro":"^3.0.0"},"devDependencies":{"c8":"^11.0.0","eslint":"^9.39.3","gh-pages":"^6.1.0","mitata":"^1.0.34","neostandard":"^0.13.0","rollup":"^4.62.2","rollup-plugin-dts":"^6.4.1","typedoc":"^0.28.19","typescript":"^6.0.3","vite":"^8.1.2","vite-plugin-singlefile":"^2.3.3"},"gitHead":"7c568a123a17727fa2f34a0abcabbd46437299c1","_id":"linkify-it@6.1.0","bugs":{"url":"https://github.com/markdown-it/linkify-it/issues"},"homepage":"https://github.com/markdown-it/linkify-it#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-wJ/TwpSDTLepCrQoYWYIExIKg5Zchex2Nn5yk2mFnB+6PtdkHtyLx742md9csRjjOnGkKIS/RrbY7l8D6gT9Vw==","shasum":"cd750d70fe9295eb7169e632ee67a4ff43e7f62d","tarball":"http://registry-npm.ywwl.com/linkify-it/download/linkify-it-6.1.0.tgz","fileCount":8,"unpackedSize":149190,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDBa4VRPv8gYbc7ZypbGTwZYk/bfM6LffNEDQ28hD5uGAiBEJoW6H6+7sSuZGBIFdfS4XBhQLEFF3L9BhgLHP+195A=="}],"size":36071,"noattachment":false,"key":"/linkify-it/-/linkify-it-6.1.0.tgz"},"_npmUser":{"name":"vitaly","email":"vitaly@rcopen.com"},"directories":{},"maintainers":[{"name":"vitaly","email":"vitaly@rcopen.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/linkify-it_6.1.0_1784757051711_0.3243888205231915"},"_hasShrinkwrap":false,"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":1784757051849,"_cnpm_publish_time":1784757051849,"dist-tags":{"latest":"6.1.0"}}