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

wkitd

v1.3.10

Published

> 基于`wkit`封装的一个应用框架, 提供`store`和`router`等基础服务。

Downloads

245

Readme

Wkitd

基于wkit封装的一个应用框架, 提供storerouter等基础服务。

downloads version

开发文档

开发文档

我们的特色

  • 提供迷你的单页应用开发环境
  • 无需node.js编译, 即写即用。
  • 本项目适合开发一些快速迭代简单页面、app内嵌的webview页面(无须搭建复杂的前端开发环境)

一些注意事项

  • 路由不支持嵌套, 即<router-view></router-view>只能出现1次。
  • $router对象, 只注入到使用wkit创建的组件, 其他地方可以使用getRouter()获取$router对象。
  • 所有路由页面和组件, 均可使用getCurrentPage()获取当前的页面的信息; 也可以用$route$router.route获取。
  • $store对象, 只注入到使用wkit创建的组件, 其他组件可使用getStore()获取。
  • watch()方法, 可用于监听$store$route的变化。

示例

app.js

// alias wkitd='//jscdn.ink/wkitd/latest/index.js'
import { css, html, createApp, createRouter, createWebHistory, createStore } from 'wkitd'


const store = createStore({
  foo: 123,
  bar: 456
})

import './views/home.js' // <wc-home />

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'wc-home' // element tagname !importent
    },
    {
      path: '/about',
      name: 'wc-about',
      component: () => import('./views/about.js')
    }
  ]
})


createApp({
  data:{},
  methods: {},
  render(){
    return html`
    <div class="app">
      <router-view></router-view>
    </div>`
  }
})
.use(store)
.use(router)
.mount()

index.html

<!doctype html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  <title>wkitd example</title>
  <meta name="keywords" content="">
  <meta name="description" content="">
  <link href="" rel="stylesheet">
  <script type="importmap">
    {
      "imports":{
        "es.shim":"//jscdn.ink/es.shim/latest/index.js",
        "wkit":"//jscdn.ink/wkit/latest/index.js",
        "wkitd":"//jscdn.ink/wkitd/latest/index.js",
        "fetch":"//jscdn.ink/@bytedo/fetch/latest/next.js",
        "@bd/ui/":"//jscdn.ink/@bd/ui/latest/"
      }
    }
  </script>
  <script type="module" src="/app.js"></script>
</head>
<body>
  <wc-app></wc-app>
</body>
</html>