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

prosemirror-autolink

v1.0.2

Published

Automatic link detection and creation for ProseMirror

Downloads

182

Readme

prosemirror-autolink

A ProseMirror plugin that automatically detects and converts URLs into links as you type, paste, or interact with text.

Features

  • Auto-linking on Space: Automatically converts URLs to links when you type a space after them.
  • Enter key trigger: Converts URLs to links when pressing Enter (configurable).
  • Smart Punctuation Handling: Automatically excludes trailing punctuation (e.g., . , )) from the link.
  • Paste Handling: Automatically detects if you are pasting a URL and either linkifies the current selection or inserts a link.
  • Click to Open: Option to open links in a new tab when clicked.
  • Undo Support: Backspace can undo the auto-link creation.

Installation

npm install prosemirror-autolink
# or
pnpm add prosemirror-autolink

Usage

Add the plugin to your ProseMirror state:

import { autolink } from "prosemirror-autolink";
import { schema } from "./your-schema"; // Ensure your schema has a 'link' mark

const state = EditorState.create({
    schema,
    plugins: [
        ...autolink({
            openOnClick: true,
            enableEnterTrigger: true,
            excludedTrailingChars: ['.', ',', '!', '?', ':', ';', ')', ']', '}']
        })
        // ... other plugins
    ]
});

Options

| Option | Type | Default | Description | |Prefix|Type|Default|Description| |---|---|---|---| | excludedTrailingChars | string[] | ['.', ',', ...] | Characters to exclude from the end of a detected URL. | | urlPattern | RegExp | /^https?:\/\//i | Regex to validate URLs. Must start with http:// or https://. | | openOnClick | boolean | true | Whether clicking a link node opens it in a new tab. | | enableEnterTrigger | boolean | true | Whether pressing Enter after a URL should auto-link it. | | enableBackspaceUndo | boolean | true | Whether Backspace immediately after auto-linking undoes the link. |

Requirements

Attribution

This package is built on top of ProseMirror, a robust toolkit for building rich-text editors on the web.