npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dolinks

v1.2.11

Published

Make links clickable in chosen HTML component preserving newlines symbols of your text

Readme

dolinks

Not tested with Vue3

Vue directive to make links clickable in chosen HTML component, preserving newlines symbols of your text.

Installation

$ npm i dolinks

Import

// import dolinks in your project root
import dolinks from 'dolinks'

// pass it to Vue.use() method
Vue.use(dolinks);

Additional options object:

interface IOptions {
  urlRegEx?: RegExp,
  target?: '_self' | '_blank' | '_parent' | '_top',
  disableWarnings?: boolean,
}

Pass options object as a Vue.use() parameter:

Vue.use(dolinks, options);

Usage examples

dolinks assumes that you'll pass your text to the template using the Vue "Mustache" syntax.

  1. Mark you HTML tag with v-dolinks directive:
  2. Pass text using {{ yourText }}

Preserve your \n symbols:

Input:

<template>
  <p v-dolinks :style="{'white-space': 'pre-wrap'}">
    {{ yourText }}
  </p>
</template>

<script>
  data() {
    return {
      yourText: 'Some \n splited \n https://achievki.io \n here'
    }
  }
</script>

Output:

<p style="white-space: pre-wrap;">
  "Some splited"
  <a href="https://achievki.io" target="_blank">https://achievki.io</a> 
 " here"
</p>

Sanitizes all other HTML tags:

Input:

<script>
  data() {
    return {
      yourText: 'https://example.com Let`s try to pass some <script> with <a href="https://google.com">GOOGLE LINK</a> <\/script>'
    }
  }
</script>

Output:

<p style="white-space: pre-wrap;">
  <a href="https://example.com" target="_blank">https://example.com</a>
  " Let`s try to pass some &lt;script&gt; with &lt;a href=""
  <a href="https://google.com" target="_blank">https://google.com</a>
  ""&gt;GOOGLE LINK&lt;/a&gt; &lt;/script&gt;
</p>

Options

urlRegEx

Should be valid RegExp. By this expression, dolinks will deside what text should be transformed to an <a> tag. Text, matched this regex, also will be used as a value for href atribute.

Default:

/https?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9@:%._\+~#=\/]{0,2048}/

target

The value for target atribute of an <a> tag. Should be a valid value for target:

  • _self
  • _blank (default)
  • _parent
  • _top

disableWarnings

If true - disables all dolinks warnings and errors. Default - false.

Known issues

  • If text inside your tag with v-dolinks directive needs to be reactive, you should re-render component on each text update (e.g. use <p v-dolinks :key="yourText">{{ yourText }}</p>). update and componentUpdated Vue directive hooks not working correctly with 1.2.0 and disabled for 1.2.1.

License

MIT © vladhutsal