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

daily-yoga-ui

v1.0.17

Published

vue3 components for daily yoga

Readme

Daily Yoga UI

Vue 3 组件库和工具函数集合

安装

npm install daily-yoga-ui

使用方式

全局注册组件

import { createApp } from "vue";
import DailyYogaUI from "daily-yoga-ui";
import "daily-yoga-ui/dist/yoga.css";

const app = createApp(App);
app.use(DailyYogaUI);
app.mount("#app");

按需引入组件

import { Button } from "daily-yoga-ui";
import "daily-yoga-ui/dist/yoga.css";

export default {
  components: {
    "dy-button": Button,
  },
};

使用工具函数

import {
  formatDate,
  getRelativeTime,
  getDateRange,
  DYBridge,
} from "daily-yoga-ui";

// 日期格式化
formatDate(new Date(), "YYYY-MM-DD"); // 2024-03-21

// 相对时间
getRelativeTime("2024-03-20 12:00:00"); // 1天前

// 日期范围
const [start, end] = getDateRange("month"); // 获取本月的开始和结束时间

// DYBridge 使用
DYBridge.isApp(); // 判断是否在 App 内
DYBridge.isIOS(); // 判断是否是 iOS 设备
DYBridge.isAndroid(); // 判断是否是 Android 设备
DYBridge.getAppVersion(); // 获取 App 版本号

工具函数

formatDate

格式化日期为指定的字符串格式。

formatDate(date, (format = "YYYY-MM-DD HH:mm:ss"));

支持的格式:

  • YYYY: 年份
  • MM: 月份(01-12)
  • DD: 日期(01-31)
  • HH: 小时(00-23)
  • mm: 分钟(00-59)
  • ss: 秒(00-59)
  • SSS: 毫秒(000-999)

getRelativeTime

将日期转换为相对时间描述。

getRelativeTime(date);

返回值示例:

  • 刚刚
  • x分钟前
  • x小时前
  • x天前
  • x周前
  • x个月前
  • x年前

getDateRange

获取指定类型的日期范围。

getDateRange(type); // type: 'today' | 'week' | 'month' | 'year'

返回值:[startDate, endDate]

DYBridge

Daily Yoga App 桥接工具,提供与 App 交互的方法。

// 环境判断
DYBridge.isApp(); // 是否在 App 内
DYBridge.isIOS(); // 是否是 iOS 设备
DYBridge.isAndroid(); // 是否是 Android 设备

// App 信息
DYBridge.getAppVersion(); // 获取 App 版本号
DYBridge.getDeviceId(); // 获取设备 ID
DYBridge.getLanguage(); // 获取当前语言

// 用户信息
DYBridge.getUserInfo(); // 获取用户信息
DYBridge.isLogin(); // 是否已登录

// 导航控制
DYBridge.goBack(); // 返回上一页
DYBridge.closePage(); // 关闭当前页面
DYBridge.openNewPage(url); // 打开新页面

// 分享功能
DYBridge.share({
  title: "标题",
  desc: "描述",
  link: "链接",
  imgUrl: "图片链接",
});

// 支付相关
DYBridge.pay({
  orderId: "订单ID",
  amount: "金额",
  currency: "货币类型",
});

开发

# 安装依赖
npm install

# 启动开发服务器
npm run dev

# 启动 Storybook
npm run storybook

# 构建
npm run build

# 构建 Storybook
npm run build-storybook

License

MIT