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

sy-comutils

v1.0.0

Published

> 包含 window.SYUtils 等公共方法

Downloads

1

Readme

soyoung comUtils

包含 window.SYUtils 等公共方法

1.0.0

记录: 迁移sy-conf

关于sy-conf

sy-conf是为了方便日常sy前端开发 封装的一些公共实用的函数,为各组前端开发的同学提供方便。

comUtils 与 引入第三方类库的共同点与区别

  • 与第三方类库一样, comUtils也是封装了一些公用的 函数,类似date的format, url的获取 ,cookie等的增删改查等等。 都是为了更好、更方便的进行业务开发 ,避免代码冗余等等。
  • 有时我们业务代码用不到第三方类库的大多数功能,可能只会用到某一个或多个功能,comUtils 是公司自己的前端类库,按照公司业务方向,将可能用到的封装一起,也更容易去维护,更新迭代。另外各组同学有什么好的功能,也可添加进来,共同造就一个功能强大的js类库。

下载引用

可以直接通过npm install 来引入到你的项目中

 npm install sy-comUtils --save 

npm install

也可以通过我们的cli脚手架来安装。

  sy-cli comUtils // 需要全局有sy-cli 脚手架
  // 若无脚手架同学,可移步sy-cli 查看安装方式及cli内容 

sy-cli

引入方式

  • commonJS
   require('sy-comUtils')
  • ES Module
   import 'sy-comUtils'
  • CDN (注意: 必须是https)
    • https://cdn.jsdelivr.net/npm/sy-comUtils@当前版本号/index.js

window.SYUtils

  • check (验证)
    • 手机 phone
    • 邮箱 email
    • 固话 telPhone
    • 姓名 name
    • 数据类型 type
    • 身份证 idCard
    • 汉字 character
    • 图片 img
    • 视频 video
    • 文档 office
    • ……
  • cookie 、storage
    • 包含cookie 、sessionStorage 、localStorage 的设置,获取及删除
  • url
  • 包括url的获取,格式化url参数等
  • type(数据类型)
  • array - 包括常规的一些数组操作等等
  • string - 包括常规的一些字符串操作等等
  • number - 包括常规的一些number操作等等
  • date - 包含时间戳和日期的转换,以及合法日期的验证
  • object - 包含extend 等..
  • type - 包含获取,验证数据格式等等