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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuepress-plugin-copyright

v1.0.2

Published

A VuePress plugin which handles copy behaviors.

Downloads

658

Readme

vuepress-plugin-copyright

npm

vuepress-plugin-copyright is a VuePress plugin that handles copy behaviors.

Usage

Global Installation

npm install -g vuepress-plugin-copyright
# OR
yarn global add vuepress-plugin-copyright

Local Installation

npm install vuepress-plugin-copyright
# OR
yarn add vuepress-plugin-copyright

Add to config.js

module.exports = {
  plugins: [
    ['copyright', {
      noCopy: true,   // the selected text will be uncopiable
      minLength: 100, // if its length is greater than 100
    }],
  ]
}

or

module.exports = {
  plugins: {
    copyright: {
      // disable the plugin by default
      // you can activate the plugin in frontmatter
      disabled: true,
      // texts will be unselectable
      noSelect: true,
    },
  }
}

Use Frontmatter

You can enable or disable this plugin for the current page in frontmatter:

---
copyright: false # disable the plugin in this page
---

You can also do some local configuration:

---
copyright:
  minLength: 40 # It will override global configuration.
---

Custom Clipboard

You can customize your clipboard with clipboardComponent. Here is a simple example:

<template>
  <div>
    <p>
      Copyright © VuePress Community
      Link: <a :href="location">{{ location }}</a>
    </p>
    <div v-html="html"/>
  </div>
</template>

<script>

export default {
  props: ['html'],

  created () {
    this.location = window.location
  },
}

</script>

Configurations

Options marked with are also allowed in frontmatter. Options marked with only take effect when the default clipboard component is used.

disabled

  • type: boolean
  • default: false

Whether to disable this plugin by default.

noCopy

  • type: boolean
  • default: false

Whether to prohibit copying.

noSelect

  • type: boolean
  • default: false

Whether to prohibit selecting.

minLength

  • type: number
  • default: 0

The minimum text length that triggers the clipboard component or the noCopy effect.

authorName

  • type: string | Record<string, string>
  • default: 'Author'

Author name. You can provide a string or an i18n object, for example:

{
  "en-US": "Author",
  "zh-CN": "作者"
}

clipboardComponent

  • type: string
  • default: undefined

The path to the custom clipboard component. If a relative path is specified, it will be resolved based on sourceDir.