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

magu-plugin-share-link

v0.0.1

Published

Magu plugin that generate a link for sharing or introduction

Readme

magu-plugin-share-link

Magu plugin that generate a link for sharing or introduction

Build Status XO code style

Install

yarn add magu-plugin-share-link
npm install magu-plugin-share-link

Usage

magu({}, [shareLink({
  //
  // The following is the default setting
  //

  // Selector to be processed
  selector: 'share-link',

  // `List of classes used in alternativeElement
  classNames: {
    block: 'share-link__block',
    section: 'share-link__section',
    image: 'share-link__image',
    meta: 'share-link__meta',
    title: 'share-link__title',
    description: 'share-link__description'
  },

  // HTML to replace selector
  alternativeElement: `...`,

  // Pageres options
  pageresOpts: {
    crop: true,
    scale: 0.23426,
    filename: (() => {
      if (process.env.NODE_ENV === 'dev') {
        return '<%=url%>';
      }
      return '<%= date %> - <%= url %>-<%= size %><%= crop %>';
    })()
  },

  // sizes for pageres.src
  imageSizes: ['1366x844'],

  // output dir for pageres.dest
  imageDest: null,

  // Dirname of image on server
  publicImageDir: '/'
})])
  .process(`${__dirname}/markdown.md`)
  .then(result => console.log(result.html));

Example

If it is markdown like this

<share-link href="https://github.com/"></share-link>

<share-link></share-link>

It will be

<script>
  var style = document.createElement('style');
  style.innerHTML = '.share-link__block{display:block;text-decoration:none;color:inherit}.share-link__section{min-height:8em;position:relative}.share-link__image {position:absolute;width:320px;height:100%;background-size:cover}.share-link__meta{font-size:.9em;padding:.5em 1em .5em calc(320px + .5em)}.share-link__title{font-weight:700}.share-link__description{font-size:.8em}';
  document.head.appendChild(style);
</script>
<p>
  <a class="share-link__block" href="https://github.com/">
    <section class="share-link__section">
      <div class="share-link__image" style="background-image: url(/2017-01-20 - github.com-1366x844-cropped.png)"></div>
      <div class="share-link__meta">
        <div class="share-link__title">How people build software &#xB7; GitHub</div>
        <p class="share-link__description"></p>
      </div>
    </section>
  </a>
</p>

An href attribute is mandatory for the <share-link/> element. Please write the URL you want to share as href value. If there is no href attribute, delete the <share-link/> element without replacing it.

License

The MIT License (MIT)

Copyright (c) 2016 nju33 [email protected]