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

@ytfee/schema

v0.0.5

Published

`yarn add @ytfee/schema` or `npm install @ytfee/schema` - broswer ``` bash import schema from '@ytfee/schema' console.log(schema.getVersion())

Downloads

1

Readme

使用方法

yarn add @ytfee/schema or npm install @ytfee/schema

  • broswer
import schema from '@ytfee/schema'
console.log(schema.getVersion())

or

import { getVersion } from '@ytfee/schema'
console.log(getVersion())
  • node
const schema = require('@ytfee/schema')
console.log(schema.getVersion())

or

const { getVersion } = require('@ytfee/schema')
console.log(getVersion())

方法说明

dateExp

  • 目前支持的表达式清单:
  '现在': 'yyyy-MM-dd HH:mm:ss'
  '上个小时': 'yyyy-MM-dd HH:mm:ss - PT1H'
  '今天开始': 'yyyy-MM-dd 00:00:00'
  '今天结束': 'yyyy-MM-dd 23:59:59'
  '明天开始': 'yyyy-MM-dd 00:00:00 + P1D'
  '今天': 'yyyy-MM-dd'
  '昨天': 'yyyy-MM-dd - P1D'
  '上周': 'yyyy-MM-dd - P1W或yyyy-MM-dd - P7D'
  '本周一': 'yyyy-MM-dd - PeD + P1D'
  '下周一': 'yyyy-MM-dd - PeD + P8D'
  '本月第一天': 'yyyy-MM-01'
  '上个月第一天': 'yyyy-MM-01 - P1M'
  '下个月第一天': 'yyyy-MM-01 + P1M'
  '本月最后第一天': 'yyyy-MM-01 + P1M - P1D'
  '今年第一天': 'yyyy-01-01'
  '明年第一天': 'yyyy-01-01 + P1Y'
  '今年最后一天': 'yyyy-12-31或yyyy-01-01 + P1Y - P1D'
  • 使用说明:
/**
  *
  * 时间格式表达式及解析:
  * @param { string } expression
  *
*/

import { DateExp } from '@ytfee/schema'
const DE = new DateExp('yyyy:MM:DD HH:mm:ss')
// 获取表达式清单
console.log(DE.defaultFormat())
// 转换为时间
console.log(DE.exec())

基础规范

  1. src/main.js 为入口文件,导入所有方法
  2. src/_aBb*.js 下横杠驼峰为 公共方法
  3. src/aBb.js 驼峰格式为 工具方法
  4. src/AaBb.js 大驼峰格式为 工具类

发布规范

  1. 必须通过eslint和jest校验
  2. npm采用语义化版本,共三位,以’.’隔开,从左至右依次代表:主版本(major)、次要版本(minor)、补丁版本(patch)。
npm version patch
npm version minor
npm version major