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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mcswift/vue-collection

v0.4.4

Published

## Install

Downloads

43

Readme

@mcswift/vue-collection

Install

# use pnpm
pnpm add @mcswift/vue-collection

# use npm
npm i @mcswift/vue-collection --save

# use yarn
yarn i @mcswift/vue-collection

Only pnpm has been test.

Usage

Components

Markdown

A component for render markdown content

import { ref } from "vue"
import { Markdown } from "@mcswift/vue-collection"
// or 
import { Markdown } from "@mcswift/vue-collection/markdown"
const DemoView = defineComponent(()=>{
  const content = ref(`# title ...`) // markdown string
  const className = "my-markdown"
  const aStyle = {
    color:"#fff"
  } // or color:#fff
  return  (
    <Markdown
      content={content.value}
      className={className}
      aStyle={aStyle}
    >
    </Markdown>
  )
})

Browser

A component for render iframe

import { ref } from "vue"
import { Browser } from "@mcswift/vue-collection"
// or 
import { Browser } from "@mcswift/vue-collection/browser"
const DemoView = defineComponent(()=>{
  const src = ref(`https://mcswift.me`)
  const width = ref<number|string>("1200px")
  const height = ref<number|string>("800px")
  return  (
    <Browser
      src={src.value}
      width={width.value}
      height={height.value}
    >
    </Browser>
  )
})

ECharts

A component for render ECharts

import { ref } from "vue"
import type { EChartsOption } from "echarts"

import { ECharts } from "@mcswift/vue-collection"
// or 
import { ECharts } from "@mcswift/vue-collection/echarts"
const DemoView = defineComponent(()=>{
  const options = ref<EChartsOption>({})
  const width = ref<number|string>("1200px")
  const height = ref<number|string>("800px")
  return  (
    <ECharts
      options={options.value}
      width={width.value}
      height={height.value}
    >
    </ECharts>
  )
})

MountProvider

A component for insert Provider component and provide hooks for render something by function style.

// top component
import { ref } from "vue"
import { FooProvider, BarProvider } from "some=package"
import { MountProvider, defineProvider } from "@mcswift/vue-collection"
// or 
import { MountProvider, defineProvider } from "@mcswift/vue-collection/mount-provider"
const TopView = defineComponent(()=>{
  // Array order related provider component nest order
  const providers = [
    // defineProvider is help extract props type, I can't find method straight extract type for Record.
    defineProvider(FooProvider,{
      // ...props
    }),
    defineProvider(BarProvider,{
      // ...props
    })
  ]
  return  (
    <MountProvider
      providers={providers}
    >
    </MountProvider>
  )
})

// sub component
import { ref } from "vue"
import { useFoo } from "some=package"
import { useMount } from "@mcswift/vue-collection"
// or 
import { useMount } from "@mcswift/vue-collection/mount-provider"
const FarView = defineComponent((props)=>{
  return <div class={props.className} ></div>
},{props:{
  className:{
    type:String
  }
}})
const SubView = defineComponent(()=>{
  const foo = useFoo() // from Foo Provider
  for.doSth()

  const mount = useMount()
  const className = "--sth"
  const mountCtrl =  mount({
    // bla
    content:()=><FarView className={className} ></FarView>
    // or
    component:FarView,
    props:{
      className
    }
  })
  return  (
    <div></div>
  )
})

Utils

normalizeStyleText

A function for 'style' which be accept for component style attribute, transform to string.

import type { CSSProperties } from "vue"

export function normalizeStyleText(style: CSSProperties|string|undefined):string